Skip to content

Comment on In Defence of TypeScript Enums

Comments

`if (color === "Red") {`

This counter example against using unions of literals would result in a compiler error ts(2367). Which only furthers the argument for using unions of literals instead.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.