An introduction to TypeScript's `never` type, explaining what it represents and two practical use cases: functions that never return (e.g., those that always throw), and exhaustive type checking in discriminated unions. A code example shows how assigning an unhandled union member to a `never`-typed variable causes a compile-time error, helping catch missing cases at build time.
Sort: