DEV Community

Discussion on: 9 tricks that separate a pro Typescript developer from an noob 😎

Collapse
 
ruppysuppy profile image
Tapajyoti Bose

Yeah as mentioned in the article, enums may break pre-existing data in the DB if new values are introduced (if you don't explicitly mention the mapped values). If you plan to use enums, mapping them to a specific value is a non-negotiable, but you can always use constant objects, mapping the same values.

I personally prefer using enums & haven't run into any issues over the past 4 years apart from the unmapped enums being overwritten