+ 2
How this code output 11 help!!
var x=1; for(;x<6;x+=2){ x=x*x; } alert(x)
1 Odpowiedź
+ 18
after loop1 ) x=1*1 + 2 =3
[3 <6 , condition true]
after loop2) x=3*3 + 2 =11
condition false [11 is not < 6]
//loop stops
var x=1; for(;x<6;x+=2){ x=x*x; } alert(x)