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.
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
+ 5
what do you think is the difference?