Hacker News new | ask | show | jobs
by jacobr 1608 days ago
The TypeScript documentation even states "In modern TypeScript, you may not need an enum when an object with as const could suffice ... The biggest argument in favour of this format over TypeScript’s enum is that it keeps your codebase aligned with the state of JavaScript, and when/if enums are added to JavaScript then you can move to the additional syntax" https://www.typescriptlang.org/docs/handbook/enums.html#obje...