Need Assistance?

support@tutorialshub.in

Advanced Type System

typeof, keyof & Indexed Access Types

ADVERTISEMENT
TypeScript Free Lesson
5 min read
ADVERTISEMENT

Use keyof User to get a union of all keys on User, and indexed access (User['role']) to extract the exact type of a single property.

ADVERTISEMENT
Hi, I'm Tuby! Here to help you