# Exhaustive matching in TypeScript

DevFeed: [Exhaustive matching in TypeScript](<https://devfeed.tech/articles/exhaustive-matching-in-typescript-48191.md>)

Original publisher: [Read original article](<https://tkdodo.eu/blog/exhaustive-matching-in-type-script>)

Published: 2020-08-09T00:00:00Z

Content type: article

Language: en

Sources: [TkDodo](<https://devfeed.tech/sources/tkdodo-s-blog.md>)

Topics: [TypeScript](<https://devfeed.tech/topics/typescript.md>), [exhaustive matching](<https://devfeed.tech/topics/exhaustive-matching.md>), [pattern matching](<https://devfeed.tech/topics/pattern-matching.md>), [Code](<https://devfeed.tech/topics/code.md>), [Front end](<https://devfeed.tech/topics/frontend.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>)

Tags: [compiler](<https://devfeed.tech/tags/compiler.md>), [exhaustive-matching](<https://devfeed.tech/tags/exhaustive-matching.md>), [frontend](<https://devfeed.tech/tags/frontend.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [typescript](<https://devfeed.tech/tags/typescript.md>)

## AI overview

This article explains exhaustive matching in TypeScript and how compiler checks can reveal unhandled states when developers add new branches or shapes. It contrasts exhaustive matching with default cases and discusses the risks of silently handling newly introduced states incorrectly.

## Source excerpt

Keep reading.