---
title: "Comment by Tarun Sharma on \"10 TypeScript Types Every Frontend Dev Should Know\" | Hashnode"
description: "Good list. The one thing I would add to the discriminated union point is the exhaustiveness check. A default case that assigns the value to a const of type neve"
url: "https://hashnode.com/posts/10-typescript-types-every-frontend-dev-should-know/6a91a613417a4f39bb5fa9f9/comment/6a9431bcfcb06d13587febb7"
---

[Discussion](https://hashnode.com/posts/10-typescript-types-every-frontend-dev-should-know/6a91a613417a4f39bb5fa9f9)

Comment [10 TypeScript Types Every Frontend Dev Should Know](https://hashnode.com/posts/10-typescript-types-every-frontend-dev-should-know/6a91a613417a4f39bb5fa9f9)

[Tarun Sharma](https://hashnode.com/@101beardo)

[Aug 30](https://hashnode.com/posts/10-typescript-types-every-frontend-dev-should-know/6a91a613417a4f39bb5fa9f9/comment/6a9431bcfcb06d13587febb7)

Good list. The one thing I would add to the discriminated union point is the exhaustiveness check. A default case that assigns the value to a const of type never turns "I added a new variant and forgot to handle it" from a runtime surprise into a compile error. Without that the union narrows fine but nothing forces you to cover every branch. Also worth flagging that narrowing only works while the discriminant stays a literal type, one spread or a widened assignment upstream and status becomes plain string and the whole thing quietly stops narrowing.
