DEV Community

Omari
Omari

Posted on

Are TypeScript enums Still Bad?

If you search for TypeScript enums online, you’ll see they get a lot of hate. Have there been any improvements to enums over time, or are they still generally frowned upon?

Top comments (2)

Collapse
 
papooch profile image
Ondřej Švanda

All the hate about typescript enums is fueled by people who either never used typescript or intentionally used them wrong (and frankly, most of the proposed "fixes" to them is a bunch of unreadable mess #hot_take). Of course they have some issues, which can be said about virtually all useful things, but if you know how to use them, they are an invaluable feature.

Collapse
 
mistval profile image
Randall

I've never heard that TypeScript enums are bad, and happily use them all the time.