+ 1
Why this code give the answer 8 ?,I don't know of this,please explain given below this js code!
var sum=0; var x=3; var y=5; for(x;x<=y;x++){ if(x==4) continue; sum+=x; } alert(sum);
3 RĂ©ponses
+ 2
When x=3
sum=sum+x
=0+3=3
when x=4 ,control goes back to loop due to continue keyword and now x=5 so
sum=sum+x
=3+5=8
+ 1
Thanks đ
0
âïž,your welcome