JavaScript/保留字/while
外觀
< JavaScript | 保留字
Thewhile子句包含一個條件,該條件決定何時 do 迴圈結束。
| 上一個: volatile | 保留字 | 下一個: with |
Thewhile子句包含一個條件,該條件決定何時 do 迴圈結束。
var array = [2, 3, 5, 7, 10, 11], i = 0, result = 1;
do {
result += array[i++];
if (result%2 == 0) {
continue;
} else if (result > 20) {
break;
} else {
console.log("result = " + result);
}
} while (i < array.length)
result = 3 result = 11
| 上一個: volatile | 保留字 | 下一個: with |