Example
label1:
for (a = 0; a < 3; a++) { //The first for statement is labeled "label1"
loop2:
for (b = 0; b < 3; b++) { //The second for statement is labeled "label2"
if (a === 1 && b === 1) {
continue label1;
}
alert("a = " + a + ", b = " + b);
}
}
for (a = 0; a < 3; a++) { //The first for statement is labeled "label1"
loop2:
for (b = 0; b < 3; b++) { //The second for statement is labeled "label2"
if (a === 1 && b === 1) {
continue label1;
}
alert("a = " + a + ", b = " + b);
}
}
Example Program:- (Editor)
Editor is Loading...
Advertisement
0 nhận xét:
Đăng nhận xét