更新时间:2022-01-11 03:27:36
conitnue
,将返回while循环.并且taskToDo的递减永远不会超过2.
conitnue
, will go back to the while loop. and tasksToDo will never get decremented further than 2.
var tasksToDo = 3
while (tasksToDo > 0) {
if (tasksToDo == 2) {
tasksToDo--; // Should be here too.
continue;
}
console.log('there are ' + tasksToDo + ' tasks');
tasksToDo--;
}