+ 16
what is output
for (x=5; x>=9;x--); x--; alert(x);
49 Réponses
+ 13
maybe 4.
because loop starts from 5 but it won't run because condition is false.
then it will go for x--, it will make x 4.
alert(x); will popup 4 as a answer.
+ 11
4
+ 9
yes, it's right. the for loop just creates x.
+ 8
sorry guess
+ 8
4
+ 7
4
+ 7
14
+ 7
i know it. but anyone was giving answer 4. and i gave 14 it's just for fun. ok boos
+ 7
4
+ 5
Most likely 4. @)
Good luck!
+ 5
4
+ 5
X is 5, and the loop doesnt run, so shouldn't it still be 5?
+ 5
Output will be 4
+ 5
ADIL GAAFER FATHELRAHMAN no you're wrong because the for loop just creates x and assign 5 to it. after, x is decremented (-1) and its value is printed to screen. so x = 4.
+ 5
what would the output be for:
for(x=5;x=5;x--);
alert(x);
+ 4
4
+ 4
oh
+ 4
I think 4.
+ 4
yes, it's right. the for loop just creates x.
+ 3
Åtomıc no because x is decremented after the for loop which doesn't run