Users of uglify-es, can you enlighten me what’s supposed to happen to `const`? `var` is obviously shorter so is there any reason it doesn’t compile down?
It should be safe (a sound transformation) to compile const to var as long as there's no mutations to the variable, no eval, and no hoisted functions. With hoisted functions, you also need to confirm that they definitely aren't called before initialization.
-
-
Would it be safer to compile to `let`?
-
Compiling to let would eliminate the TDZ problem, so yes.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.