DEV Community

Discussion on: We don't have to use Enums on TypeScript? 【Discussion】

Collapse
 
taishi profile image
Taishi

Thanks @firstwhack !

In my example there is no need to make use of index and Union types makes sense in my opinion. And most of the cases, Union types works fine.

As @peerreynders said here, it's trade-offs.

My opinion is, we don't have to use Enums if it's not necessary.

Also

enums are important for readability and re-use

This is your personal opinion and not true for anyone for any cases.

I mean, I prefer Union types to Enums for readability haha.

Collapse
 
Sloan, the sloth mascot
Comment deleted
 
taishi profile image
Taishi

Thanks you too!