What happens when you use `never` in a union type like `string | never`?

TypeScript Professional Hard

TypeScript Professional — Hard

What happens when you use `never` in a union type like `string | never`?

Key points

  • `never` type eliminates itself in a union
  • Union with `never` simplifies to the other type
  • `never` represents a type with no values

Ready to go further?

Related questions