Get to know MDN better
此頁面由社群從英文翻譯而來。了解更多並加入 MDN Web Docs 社群。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
continue 語法可用來重新開始 while、do-while、for、label 語法。
continue 語法如下︰
以下範例示範加上 continue 語法的 while 循環,continue 語法會在 i 值為 3 時執行。因此,n 的值依序為 1、3、7、12。
已加上標籤的語法 checkiandj 內含已加上標籤的語法 checkj。如果遇到 continue,程式會終止 checkj 這一次的反覆過程,並開始下一次的反覆過程。每當遇到 continue,就會反覆執行 checkj 直到他的條件返回 false 為止。當返回 false 時,checkiandj 語句完成了餘數的計算,且 checkiandj 會反覆執行,直到他的條件返回為 false 為止。當返回 false 時,程式繼續執行 checkiandj 後面的語句。
如果 continue 有一個 checkiandj 標籤,程式就會從 checkiandj 語句的開始處繼續執行。
This page was last modified on 2025年7月16日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.