|
|
|
|
|
by ksbrooksjr
1362 days ago
|
|
Const enums get completely erased by the compiler, and modules are a native js feature. Non-const enums and namespaces are probably the only aspects of typescript that actually have any significance at runtime, but they get compiled into simple objects. The compiler output is very close to what you'd write by hand. Take a look at this compiler output here [1]. Unless you're constantly recreating enums and namespaces inside of a loop (which you'd never do in real life code), I can't imagine there'd be any performance penalty. [1] https://www.typescriptlang.org/play?target=99#code/HYQwtgpgz... |
|