4/1/2025 at 11:21:12 PM
I think the author missed that we are criticising typescript's enum implementation not the concept of enums in general.They transcribe to something better defined in javascript. Typescript itself akwardly sits on the fence of almost entirely erasable and some decisions only make sense if that was the goal, like import files having a js rather than the ts extension that would point to the file in source.
Enums become javascript objects in a very leaky abstraction full of footguns. There are plenty of articles that cover these and this author seems to have written them off as 'not holding it right' but a good language feature fits in the hand naturally to stretch the analogy.
by TheCycoONE