Typescript: keyof typeof

preview_player
Показать описание
Typescript keyof typeof is something nice to use in typescript.

When having an object that you use to define keys for a later reference (e.g. translations), use `keyof typeof` to extract those keys into a type.

This way you will know in the rest of the code what your options are, and references will be typesafe.
Рекомендации по теме
Комментарии
Автор

Good Work, try to explain with a practical use case would be very helpful for future videos!

TheFilburt
Автор

this is typing as a voice, not a tutorial

MarufAlom
Автор

Reading out loud what you're writing doesn't really qualify as a tutorial.

i-heart-google