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

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

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

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

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

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