A committed and outcome-oriented software developer with over 6 years of experience in the field of software development, complemented by 2 years of research involvement in artificial intelligence.
I've read from other articles that enums are to be avoided when it comes to data structuring in TypeScript. Lemme know if you have a different opinion. Overall, this is a well summarized reference and thanks for sharing.
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
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I've read from other articles that enums are to be avoided when it comes to data structuring in TypeScript. Lemme know if you have a different opinion. Overall, this is a well summarized reference and thanks for sharing.
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 useenums
, 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