Re:TypeScript enums: use cases and alternatives
by zarzavat on Tuesday January 21, 2025 @02:12AM
(#42777362)
enums are a feature of most programming languages. It doesn't matter to me why TypeScript had to add them, just like it doesn't matter why JS has functions or if statements.
90% of the enums I use are regular integer enums. I don't get much use out of string enums, as you say union types do that job just fine.
90% of the enums I use are regular integer enums. I don't get much use out of string enums, as you say union types do that job just fine.