DEV Community

Discussion on: The Dangers of TypeScript Enums

Collapse
 
wrldwzrd89 profile image
Eric Ahnell

An obvious use case is expressions that optimize to constants during compilation, as in the bitwise OR of two values example above, because it makes the source code clearer without compromising what enumerations bring to programming.

Collapse
 
stojakovic99 profile image
Nikola Stojaković

Thanks. That reminds me of the constexpr in C++.