What does `type IsNever = [T] extends [never] ? true : false` accomplish?

TypeScript Professional Hard

TypeScript Professional — Hard

What does `type IsNever = [T] extends [never] ? true : false` accomplish?

Key points

  • This code snippet specifically checks for an exact match with the `never` type.
  • It does not convert never types to boolean or create a type guard for never.
  • The use of `extends` in this context is crucial for the comparison.

Ready to go further?

Related questions