On Fri, Apr 17, 2015 at 7:53 AM, Glen Huang <[email protected]> wrote:
> I've completely replaced "var" with "let" in my es 2015 code, but I noticed 
> most variables I introduced never change.

Note that `const` has nothing to do with the value of a variable
changing or not. It can still change:

    const foo = {};
    foo.bar = 42; // does not throw

`const` indicates the *binding* is constant, i.e. there will be no
reassignments etc.

In my post-ES6 code, I use `const` by default, falling back to `let`
if I explicitly need rebinding. `var` is for legacy code.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to