0
var x=1; for(; x<10;x++){ x+=x;} document.write(x) Can someone explain how thisnequals 15, i'm super confused
Can someone explain how this comea to 15
2 Antworten
+ 4
X = 1
Then, x = x + x = 2
X++... X will be 3.
Similarly 3 + 3 = 6
X++ = 7
7 +7 = 14
X++ = 15
Now condition becomes false and hence the loop terminates !!!
0
Thanks so much i get it now, i thought the var was seperate but wach rotation can change the variable