I have a for loop like so
for (var i = 0; i < 100; i += 4) {
// code with i;
}
I would like to change the value of i
to a certain value from within the loop. I am aware you could use continue
to change the value of i
after evaluating the final-expression, but what if I wanted to change the value of i to something more specific like 40?
Here's one of my attempts
loop:
for (var i = 0; i < 100; i += 4) {
for (var i = 0; i <= 40; i++) {
continue loop;
}
}
Is there a better way of doing this?