What is the result of `type A = keyof { a: string; b: number }`?

TypeScript Professional Hard

TypeScript Professional — Hard

What is the result of `type A = keyof { a: string; b: number }`?

Key points

  • The `keyof` operator returns a union type of keys.
  • The options 'string | number' and 'string' are incorrect because they do not represent the keys of the object.
  • The option `{ a: string; b: number }` is incorrect as it represents the original object, not its keys.

Ready to go further?

Related questions