4 ms·
That is correct. However, I still prefer using union types so that I'm not locked in to TypeScript. By using only union types as "enums" and never using enums
by munchor 7y ago
That is correct. However, I still prefer using union types so that I'm not locked in to TypeScript.
By using only union types as "enums" and never using enums or namespaces, I guarantee that all the TS-specific code I write can be erased and if I ever were to use just JavaScript in the future, I could.
Also, I use Babel to transpile TS to ES3.
- reaktivo 7y agoYou can have the best of both worlds, see this comment https://news.ycombinator.com/item?id=21134911 https://news.ycombinator.com/item?id=21134911