What does `infer` do inside a conditional type?

TypeScript Professional Hard

TypeScript Professional — Hard

What does `infer` do inside a conditional type?

Key points

  • `infer` helps TypeScript infer types within conditional branches
  • It is used to declare a type variable to be inferred
  • This feature is useful for creating flexible and powerful type definitions

Ready to go further?

Related questions