Should "const" be favored over "let"?
f.bagnardi at gmail.com
Fri Apr 17 07:46:32 UTC 2015
I've switched to let/const completely. The gain of using const isn't
performance (you can statically analyze whether any non-global is
potentially assigned to). The gain from const is that it's very very easy
for a human to statically analyze.
If I see a let binding, I know I need to be a bit more careful with editing
that piece of code.
I originally thought this'd be a terrible idea, but it's been working great
On Thu, Apr 16, 2015 at 10:53 PM, Glen Huang <curvedmark at gmail.com> wrote:
> I've completely replaced "var" with "let" in my es 2015 code, but I
> noticed most variables I introduced never change.
> Should I replace them with "const"? Will there be any performance gain for
> most browsers? If so, should such performance gain be considered micro
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss