bottom type
A type that no value belongs to, so it fits into every other type; in TypeScript this is never.
In more detail
It describes the empty set of values. Functions that always throw return it, and narrowing a union until nothing remains produces it.
Related terms
- never (type) — The TypeScript type with no values, used for code that can never be reached or functions that never return.
- top type — A type that every other type fits into, so it can hold any value; in TypeScript both unknown and any play this role.
- types as sets — A way of thinking about types as sets of possible values, so unions are combined sets and intersections are overlaps.
Taught in
- Verify Your Environment: Running tsc And Bun TypeScript — Production TypeScript
- void, undefined And null: Exact Optional Property Types — Production TypeScript
- never: The Bottom Type And Exhaustive Switch Checking — Production TypeScript
- The Spine Artifact: Generating Typed Models From OpenAPI — Production TypeScript