Keys as Type
EasyDefine MYType so its values are keys of the obj object.
TypeScript•UTF-8
Run your code to see results.
Click the Run button above
Keys as Type
EasyDefine MYType so its values are keys of the obj object.
Examples:
Input 1: type MYType = keyof typeof obj
Output 1: "name" | "age"
Output
Run your code to see results.