0

How can "continue" be used in a for loop?

I understand you can use it in a while loop, but is there anything similar for a for loop? Thanks for your answers.

3rd Jan 2018, 6:34 PM
Jérôme GANGNANT
Jérôme GANGNANT - avatar
2 Antworten
+ 2
I'll give you an example: for(var i=1;i<3;i++) { if(i==2) { continue; } document.getElementsByTagName("input")[0].value += i + " "; } <input type=text> *********************/ Input's value: 1 3
3rd Jan 2018, 6:51 PM
Luca Marseglia
Luca Marseglia - avatar
+ 5
what do you think is the difference?
3rd Jan 2018, 6:50 PM
Oma Falk
Oma Falk - avatar