What is the `const` type parameter modifier in TypeScript 5.0+?

TypeScript Professional Hard

TypeScript Professional — Hard

What is the `const` type parameter modifier in TypeScript 5.0+?

Key points

  • `const` modifier infers the most specific type
  • No need for `as const` to narrow down the type
  • Enhances type safety in generic arguments

Ready to go further?

Related questions