What is a conditional type’s behavior when given a union type as the checked type parameter?

TypeScript Professional Hard

TypeScript Professional — Hard

What is a conditional type’s behavior when given a union type as the checked type parameter?

Key points

  • Conditional types distribute over each union member separately
  • Naked type parameters allow for this distribution behavior
  • This allows for more precise type checking in TypeScript

Ready to go further?

Related questions