Published on

What are Enums in TypeScript, and When Should you use Them

Authors

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.

Fallback text 1

What happens to Enum at compile time?

Fallback text 2

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.

Fallback text 3