4 ms·
> The addition of the Let statement to ES6 makes this discussion moot I don't think it does. The JS broken behaviour described in the article is that if you ha
by epidemian 13y ago
> The addition of the Let statement to ES6 makes this discussion moot
I don't think it does. The JS broken behaviour described in the article is that if you happen to forget the "var" keyword when assigning a variable then you will create a global variable. "let" is great, but it doesn't fix that problem.
- masklinn 13y ago> The JS broken behaviour described in the article is that if you happen to forget the "var" keyword when assigning a variable then you will create a global variable. Use strict mode, problem gone. (alternatively, jshint/jslint or a good IDE will warn about implicit global declarations, it's not a very difficult pattern to check for)