+ 1
Help me to understand why it is printing 16; JavaScript
var sum=0; for(i=4; i<8; i++) { if (i == 6) { continue; } sum += i; } document.write(sum);
2 odpowiedzi
+ 6
1st case i=4 then sum=4
2nd case i=5 then sum=9
3rd case i=6 continue statement used control jumps up.
4th case i=7 then sum=9+7=16
5th case i=8 not possible..so it returns the sum.
+ 1
Thanks 😊 Aditya