28 ms·
> 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 var
by 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)