代码示例:(标识:jsck_state_continue_2)
<!DOCTYPE html>
<html>
<body>

<p>单击按钮执行循环,将跳过 i 等于 3 的 step。</p>

<button onclick="myFunction()">试一试</button>

<p id="demo"></p>

<script>
function myFunction() {
  var text = "";
  var i = 0;
  while (i < 5) {
    i++;
    if (i === 3) {
      continue;
    }
  text += "<br>The number is " + i;
  }
  document.getElementById("demo").innerHTML = text;
}
</script>

</body>
</html>
运行结果: