So is this actually naming the loop to nextLoop
? So when it says continue nextLoop
, does it go back to the top right away?
var t
other languages let you break out of a selected number of inner loops, if(!x)break 2; would continue the process at a point two steps up.
I've seen complex loops with multiple loop labels, and continues called to a specific label, but I agree it can confuse the logic.
You can almost always improve the efficiency of a loop by writing it without the continue:
var total= 0;
nextLoop:
for (var i = 0; i < 7; ++i ){
for (var j = 0; j < 6 ; ++j ){
if(i>4) total++;
}
total++;
}
total++;