Re:V8 adds support for top-level await
by megous on Wednesday September 25, 2019 @09:37AM
(#21070629)
The main benefit of let/const over var is that it's block scoped. The benefit of const over let is pretty much nothing, much. It only prevents some limited form of re-binding. You can still easily re-bind const variables from inside a function:
or from an argument:
So it has limited value in any code that uses closures.
[ Parent
| on HN ]
Shadowing isn't rebinding?
If you've declared const x = 1, then that will hold for your scope?
If you go into a separate scope... Well, then you're in a separate scope?