Keys as Type

Easy

Define 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.