News for hackers. Stuff that matters.
Re:V8 adds support for top-level await by elyobo on Wednesday September 25, 2019 @02:28AM (#21068237)
I don't think I'd call any of those reasons good; the main thrust of them is "const doesn't do everything, so don't let it do anything". If that line of reasoning is appealing, then one might as well continue using var.
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:

    const x = 1;
    (function() {
        const x = 2;
        console.log(x);
    })()
or from an argument:

    const x = 1;
    (function(x) {
        console.log(x);
    })(2)
So it has limited value in any code that uses closures.
Re:V8 adds support for top-level await by e12e on Wednesday September 25, 2019 @03:12PM (#21074214)
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?

Re:V8 adds support for top-level await by elyobo on Wednesday September 25, 2019 @03:16PM (#21074255)
Neither of those rebind the `const x`, which will continue to hold the value it was given.