3 ms·
But it does warn you if you do not use the var keyword the first time you assign a value to a variable. In JavaScript that is not really necessary since it will
by swolchok 17y ago
But it does warn you if you do not use the var keyword the first time you assign a value to a variable. In JavaScript that is not really necessary since it will automatically create a variable in the global scope anyway. Still it doesn't hurt to do things properly and declare the variable using the var keyword. But since the only time you are really interested in that sort of error is when you overwrite the variable from the parent scope, it becomes useless for the one thing it could have been useful for.
What about, y'know, enforcing the non-use of globals?