You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a minor detail, but something that caught my attention.
While looking into how enums are transpiled, I noticed that when an enum is exported, the variable is defined using let, but when it’s not exported, it’s defined using var.
However, when I try this in TypeScript, even exported enums are defined using var.
Why does Babel use let in this case?
Or is it possible that my TypeScript (tsc) configuration is missing something?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Ask
This is a minor detail, but something that caught my attention.
While looking into how enums are transpiled, I noticed that when an enum is exported, the variable is defined using let, but when it’s not exported, it’s defined using var.
However, when I try this in TypeScript, even exported enums are defined using var.
Why does Babel use let in this case?
Or is it possible that my TypeScript (tsc) configuration is missing something?
Ref
Beta Was this translation helpful? Give feedback.
All reactions