There won't be any performance gain. "const" is used to be much slower in v8 actually. But they fixed it as far as I know.
I think it's a code style matter. And speaking about that, realistically, most code base will never use "const" widely. Just one reason: 5 characters vs 3 characters to type. So in the name of keeping an amount of different code styles smaller, I'd say stick with "let" (except for obvious constant literals like `const PI = 3.14` on top). Just something to consider.
io.js core uses "const" everywhere though.
17.04.2015, 08:53, "Glen Huang" <[email protected]>:
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 optimization?
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

