this post was submitted on 10 Oct 2023
9 points (90.9% liked)
TypeScript
844 readers
1 users here now
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
At work, when I was helping with some frontend stuff, we used object literals.
Taken from option 2 in this blog post. https://maxheiber.medium.com/alternatives-to-typescript-enums-50e4c16600b1`___`
This is, in my opinion, the absolute best way to do it