Concept: Exhaustiveness Checking
Concept Check Medium
Question
What is exhaustiveness checking in TypeScript?
Hint
Think about switch statements on union types — what if you miss a case?
Explanation
Exhaustiveness checking ensures that all possible cases of a union type are handled in a switch or conditional. By assigning the remaining value to a never type variable in the default case, TypeScript will error if a new member is added to the union but not handled. This catches missing cases at compile time.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.