I have a for loop where I define a var i
That loop is done with, and now I need another. If I code
for ( i = 0; i < ....etc.
The warning yellow triangle appears, saying “i used out of scope.” I thought JS doesn’t have block scope - but anyway if I declare it:
for ( var i = 0; i < ....etc.
the yellow triangle then says “i is already defined.” Seems it can’t get no satisfaction.
Not fatal, but what’s behind this and what’s best practice?