运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,暗/亮
前往 Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Statements</h1> <h2>The continue Statement</h2> <p id="demo"></p> <script> let text = ""; // The first for loop is labeled Loop1: Loop1: for (let i = 0; i < 3; i++) { text += i + "<br>"; // The second for loop is labeled Loop2: Loop2: for (let i = 10; i < 15; i++) { if (i === 12) continue Loop2; text += i + "<br>"; } } document.getElementById("demo").innerHTML = text; </script> </body> </html>