TypeScript Deep Dive - Index Types / Mapped Types | JSer - Front-End Interview questions

preview_player
Показать описание

Mapped Types are very important, it works like a map function, which `in` is used to iterate all the possible keys.

Hi I'm a JavaScript engineer who is not good at algorithms,
and currently practicing leetCode & BFE.dev. If you are interested, maybe we can learn together.
Рекомендации по теме
Комментарии
Автор

Looking at the pluck function at 0:25 makes me realize that TypeScript has some features that aren't even supported by other languages.
I can say in Java that a method or function will accept a map and return an array of values. What I can't say is that that particular array of values being returned will only contain the content of the Map values like specified in this example: T[K][]. Wow!!!
TypeScript allows us to be even more specific about the rules that specify the shape of our objects it seems.

faruzzy