Home > front end >  The continue and labels are used together, the variables in the loop body why can also increasing th
The continue and labels are used together, the variables in the loop body why can also increasing th

Time:01-25

 outer: 
for(let i=0; i<5; I++) {
If (I==3) continue the outer;
Alert (I);//0,1,2,4 why not 0... The cycle of 0,
}

For this example, after the continue to label the outer for loop, why do I still can then start from 4, should not start from 0 to cycle?

CodePudding user response:

The continue is directly for the next cycle, not from zero start cycle

CodePudding user response:

The continue outer; And not let the program flow to outer: place,

Tags: just for the for or while statement identifies a name, convenient in the case of multiple nested loop let break and continue to know which is corresponding to a layer of circulation,
  • Related