What is the difference between declaring a variable with and without var in javascript
If you’re in the global scope, there’s not much difference. Read Kangax’s answer for explanation If you are in a function, then var will create a local variable, “without var” will look up the scope chain until it finds the variable or reaches the global scope (at which point it will create it) There is […]
What is the difference between declaring a variable with and without var in javascript Read More »