0

java script code question

why in output number from 0 to 10 without number 3? for (i = 0; i <= 10; i++) { if (i == 3) { continue; } document.write(i + "<br />"); }

23rd Aug 2020, 7:20 PM
Ziyad Aldoumany
Ziyad Aldoumany - avatar
1 ответ
0
continue is keyword is used to jump to the next iteration. Here, when i==3, the if loop executes, and when continue statement is executed, the statement document.write(..) is not executed and the program continues to the increment step and to the next iteration. So 3 is excluded.
23rd Aug 2020, 7:59 PM
Midhun Madhu
Midhun Madhu - avatar