- Published on
What are Enums in TypeScript, and When Should you use Them
- Authors
- Name
- Lucas Floriani
- @lucasfloriani13
What are Enums in TypeScript, and When Should you use Them
What are Enums in TypeScript, and When Should you use Them
Rewriting enum value
We can chance the start value of the enum, that always start by 0, by providing a integer to continue the counting so that Reset will have value 2 and so on.
What happens to Enum at compile time?
Objects vs Enums
It's a matter of choise, both of them are good, objects will have a little more of boilerplate to get all the options possible but are more close to real JS.