this post was submitted on 10 Oct 2023
9 points (90.9% liked)
TypeScript
910 readers
37 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
That's what the typescript official docs recommend as an alternative too
https://www.typescriptlang.org/docs/handbook/enums.html#objects-vs-enums
The const keyword was added after enums. I doubt enums would exist if the feature was added earlier.