Closed dimatron closed 12 years ago
Thanks for the pull request. What is the purpose of this change?
within loops should not initiate the variables, errors can occur which then will be difficult to catch, the right to make any declarations to the top of the block function https://developer.mozilla.org/en/JavaScript/Reference/Statements/var
It is pretty common to see variables defined in loops or elsewhere even if their scope extends beyond the loop. The MDN article you referenced is rather opinionated about defining variables at the top of functions, but in practice, I think that it's sometimes even more confusing to do so.
I will likely not merge this change, but thank you for the pull request.
"Var" declares a variable for the block in the java script {} does not limit the power.