let num = 0; for (let i = 0; i < 10; i ++) { for (let j = 0; j < 10; j ++) { if (i === 5 && j === 5) { break; } a ++ ; } } console.log(num); // 95
Conditions are satisfied break out of that cycle of internal
If all conditions are met to get out of the cycle of how to do?
let num = 0; out: for (let i = 0; i < 10; i ++) { for (let j = 0; j < 10; j ++) { if (i === 5 && j === 5) { break out; } a ++ ; } } console.log(num); // 55
for loop out of label point to the current cycle block
out BREAK out when the code block is pointed out
continue empathy