0
Why doesnt this give an output?
I typed this but its not giving on output on the playground? Am i doing something wrong? for(i=4;i>1;i--) { document.write(i+"<br />"); }
5 Answers
+ 5
for(int i = 4; i > 1; i--)
EDIT:- NOT FOR JS. Thanks @Naitomea for correction
+ 3
oops, My bad @Naitomea, I will edit the answer.
+ 1
Dod you write the code in HTML or JS section?
I wonder because I just checked and it outputted
4
3
2
as intended, so the code itself is correct.
+ 1
@Meharban
JS doesn't have such data types as integer or float, instead you use the keyword var.
But it is not necessary to use it in the first statement of the loop.
0
JS section, it didnt give an error, so it might just be me :/