While you are using var, for example:
for(var i = 0; i < something; i++)
Then it is local, and you are fine, if you are not using var, you have a global variable on your hands and possible problems. In addition, if the cycle is fornested in another, you must use a different variable name for each cycle.
source
share