Hacker News new | ask | show | jobs
by azangru 698 days ago
There are union types for strings; and there are plain javascript objects (typed as const) if "namespace.name" syntax is desired. With these available, what is the point of enums?
1 comments

Namespaces are also not supported as per https://github.com/nodejs/node/blob/main/doc/api/typescript.....

I for one can can live without all these features and will be banning via eslint.

Yes. Both namespaces and enums (and probably the "private" keyword on class methods) are an early addition to the language, which would have never been added if typescript from the very start aligned closely with Ecmascript.