continue

noun

say it: “kun-TIN-yoo” /kənˈtɪnjuː/

A keyword that skips the rest of the current pass of a loop and goes straight to the next one.

What does continue do in JavaScript?

continue — Skips to the next pass of the loop.

for (const number of numbers) {
    if (number % 2 === 0) {
        continue;
    }

    firstOdd = number;
    break;
}

In a sentence

  • “When the loop reached a sold-out drink, continue skipped it and moved on to the next one.”

Level: Apprentice · More JavaScript terms at this level

Updated

In other subjects