Quiz · Type operators and utility types · lesson 2 of 8Quiz — keyofWhat does keyof T produce for an object type?[A]The union of T's property names as literal types: for { name: string; age: number } it is "age" | "name". With K extends keyof T a function accepts only those names, and T[K] gives that property's type.[B]A run-time list of T's property names, like the result of Object.keys: for { name: string; age: number } it is ["name", "age"]. That is why keyof needs a real object on its right, not a type.[C]Plain string: property names are erased like the rest of the types, so for { name: string; age: number } it is string. A parameter typed keyof T takes any string, and a typo in a name is never caught.[D]The union of the types of T's properties: for { name: string; age: number } it is string | number. With K extends keyof T a function accepts any value of those types, and T[K] gives back the property's name.← Backkeyof and indexed accessNext →typeof in types