[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Statements/continue [Back]  [Original]

continue - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

continue

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 ..

continue , .

In this article

continue [ label ];
label

, (label) .

break, continue , :

continue , , . , continue , .

continue while

while continue, , i 3-. , n 1, 3, 7 12.

js
i = 0;
n = 0;
while (i < 5) {
  i++;
  if (i === 3) {
    continue;
  }
  n += i;
}

continue

, checkiandj, , checkj. continue, checkj. continue checkj , false. , checkiandj.

continue checkiandj, checkiandj.

label.

js
var i = 0,
  j = 8;

checkiandj: while (i < 4) {
  console.log("i: " + i);
  i += 1;

  checkj: while (j > 4) {
    console.log("j: " + j);
    j -= 1;
    if (j % 2 == 0) continue checkj;
    console.log(j + "  .");
  }
  console.log("i = " + i);
  console.log("j = " + j);
}

:

js
"i: 0";

//  checkj
"j: 8";
"7  .";
"j: 7";
"j: 6";
"5  .";
"j: 5";
//  checkj

"i = 1";
"j = 4";

"i: 1";
"i = 2";
"j = 4";

"i: 2";
"i = 3";
"j = 4";

"i: 3";
"i = 4";
"j = 4";

Specification
ECMAScript 2027 LanguageSpecification
# sec-continue-statement


Web Proxy Viewer  |  New URL  |  Original Page