JS_Break and Continue | Sololearn: Learn to code for FREE!
+ 5

JS_Break and Continue

What is the output of this code with the explanation please var sum=0; for(i=4; i<8; i++){ if(i==6){ continue; } sum +=i; } document.write( sum);

27th Mar 2017, 11:25 AM
S_M_A - avatar
1 Answer
+ 9
break will stop the current loop entierly continue will skip to the next loop iteration, skipping all statements below it
27th Mar 2017, 11:53 AM
Burey - avatar