The Bottom Type Concept
What you'll learn: You'll understand what makes never the "bottom type" — a type that represents values that can never exist.
What Is a Bottom Type?
In type theory, the bottom type is a type that has no values. It sits at the very "bottom" of the type hierarchy, meaning it's compatible with every other type (it can be assigned to anything), but nothing except never itself can be assigned to it.
Think of it like an empty container that can fit through any doorway because it contains nothing, but you can never actually put anything inside it.
never as the Bottom Type
In TypeScript, never is the bottom type. It represents situations where:
- A function never returns (throws an error or runs infinitely)
- A code path is logically impossible to reach
- A value has been narrowed down so far that no valid value remains
Why This Matters
The bottom type concept is what makes never fundamentally different from void or undefined:
voidmeans "no useful return value" — the function completes, just with nothing meaningfulundefinedis an actual value that existsnevermeans "this never produces a value at all"
Because never has no values, intersecting any type with never always produces never. It's the mathematical "zero" of types — anything combined with it becomes it.
Key Takeaway: never is the bottom type — a type with no possible values, representing code paths or states that can never actually occur.