?
本文檔使用 php中文網(wǎng)手冊(cè) 發(fā)布
JScript? | 語(yǔ)言參考 |
停止循環(huán)的當(dāng)前迭代,并開始新的迭代。
continue [label];
可選的 label 參數(shù)指定 continue 應(yīng)用于哪條語(yǔ)句。
只能在 while、do...while、for、或 for...in 循環(huán)內(nèi)使用 continue 語(yǔ)句。 執(zhí)行 continue 語(yǔ)句會(huì)停止當(dāng)前循環(huán)的迭代,并從循環(huán)的開始處繼續(xù)程序流程。這樣對(duì)不同的循環(huán)類型有如下影響:
下面示例說(shuō)明了 continue 語(yǔ)句的用法:
function skip5(){ ???var s = "", i=0; ???while (i < 10) ???{ ??????i++; ??????//
跳過(guò)5
??????if (i==5)
??????{
?????? continue;
??????}
???s += i;
???}
???return(s);
}
版本 1
break 語(yǔ)句 | do...while 語(yǔ)句 | for 語(yǔ)句 | for...in 語(yǔ)句 | Labeled 語(yǔ)句 | while 語(yǔ)句