A lot of TypeScript usage stops at basic annotations — string, number, boolean — and stays there. That's fine for simple cases, but it means missing the type features that catch real bugs before they
jayesh-sojitra.hashnode.dev3 min read
React.js Frontend Web Developer | Next.js Specialist
Tarun Sharma
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.