3 ms·
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
by azangru 2y 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?
- silverwind 2y agoNamespaces are also not supported as per https://github.com/nodejs/node/blob/main/doc/api/typescript.md#unsupported-typescript-features 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.
- azangru 2y agoYes. 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.