+ 3
for loop
Hi everyone, pls why is the output of this loop 10? var x = 2; for(i = 0; i < 4; i++) { x += 2; } document.write(x);
2 Answers
+ 4
2+ 2+2+2+2 = 10
https://code.sololearn.com/WSb9uaWyk7z8/?ref=app
+ 1
Because there are 4 cycles
4 Ă 2 = 8;
x += 8 = 10;