January 2020
Intermediate to advanced
548 pages
13h 36m
English
Continuing is a shift of control from the current statement to the potential start of the next iteration. It is achieved via a continue statement.
Here is an example of continuing conditionally, so that the body of the iteration does not execute for a specific item but the iteration still continues to progress:
const numbers = [1, 2, 3];for (const n of numbers) { if (n === 2) continue; console.log(n);}// Logs: 1, 3
Continuing skips all of the code following continue in the current iteration and then moves onto whatever would naturally occur next.
Similar to the break statement, to the right side of the continue ...
Read now
Unlock full access