The more common first form of the for loop in the example below does not update of the 'i' value as expected, the second form works fine. This applies to PS CS, I have not tested it in CS2.
Code: Select all// incorrectly returns 1,2,3
for (var i = 0; i<3; i++) {
i = i+1;
alert(i);
}
// returns 1,3 as expected
for (var i = 0; i<3; i=i+1) {
i = i+1;
alert(i);
}