Skip to content
Learn Netverks

Lesson

Step 23/32 72% through track

exhaustiveness

Exhaustiveness checking

Last reviewed Jun 1, 2026 Content v20260601
Track mode
client_typescript
Means
In-browser TS
Reading
~1 min
Level
intermediate

This lesson

This lesson teaches Exhaustiveness checking—the ideas, syntax, and habits you need before moving on in TypeScript.

Without a solid grasp of Exhaustiveness checking, you will repeat mistakes in TypeScript exercises and on real pages or scripts.

You will apply Exhaustiveness checking in contexts like: Modern front-end apps, Node APIs, and any team that standardizes on TS-first tooling.

Write TypeScript, compile in the browser, run the emitted JavaScript, and check understanding with MCQs.

When the previous lesson's MCQs feel easy and you can explain Exhaustiveness checking in your own words.

Assign never in the default branch to force compile errors when a union grows and you forget a case.

Compiler help

With noImplicitReturns and never assignments, adding a union member becomes a compile error until every switch handles it—cheap regression safety.

Self-check

  1. Add a default branch assigning theme to never.

Exhaustiveness pairs well with discriminated unions when product teams add new enum-like states every sprint.

Practice: Apply exhaustiveness in the playground, then explain exhaustiveness in one sentence without looking at notes.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs in your browser in a sandboxed frame. Backend runners appear when this track’s profile allows them.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • What part of this lesson needs a second read?
  • What would you try differently in a real project?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump