摘要: Stacking multiple things on an identifier interface Fruit { name: string mass: number color: string } const Fruit = { name: "banana", color: "yellow", 阅读全文
posted @ 2022-08-08 18:30 Zhentiw 阅读(56) 评论(0) 推荐(0)
摘要: `namespace` is manily for the left over from the days where we’d refer to libraries through a single global variable. With this in mind, let’s not giv 阅读全文
posted @ 2022-08-08 18:23 Zhentiw 阅读(55) 评论(0) 推荐(0)
摘要: When working with function parameters, we know that “inner scopes” have the ability to access “outer scopes” but not vice versa function receiveFruitB 阅读全文
posted @ 2022-08-08 17:59 Zhentiw 阅读(60) 评论(0) 推荐(0)
摘要: Assume we have the following code: interface HasId { id: string } interface Dict<T> { [k: string]: T } function listToDict<T>(list: T[]): Dict<T> { co 阅读全文
posted @ 2022-08-08 17:54 Zhentiw 阅读(46) 评论(0) 推荐(0)