+ 1

Am I wrong ? Or JavaScript challenge question is wrong

I found this code on JavaScript challenge : for (var x = 0; x == x; x++) { if(x > 5 && x < 8){ document.write(x); break; } } and the answer is 6. but I try the code in playground, the result is nothing. Am I wrong ? https://code.sololearn.com/W9J9SnYJWLD5/?ref=app

17th Jun 2017, 2:52 PM
Mugfirfauzy Siregar
Mugfirfauzy Siregar - avatar
6 odpowiedzi
+ 6
Change the function name. Some keywords like "write" doesn't work as function names in JavaScript.
17th Jun 2017, 3:02 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 1
it was meant to be document.print I think
18th Jun 2017, 12:11 PM
Vincent Alexander Ochoa
Vincent Alexander Ochoa - avatar
+ 1
have you tried with netbeans?hope it will work
18th Jun 2017, 1:19 PM
SAMUEL ONYANGO OGANYO
SAMUEL ONYANGO OGANYO - avatar
0
ok.. thanks.. i'd changed the function name, it's work.. so i was wrong because of that function name.. I think I missed the lesson..
17th Jun 2017, 3:09 PM
Mugfirfauzy Siregar
Mugfirfauzy Siregar - avatar
0
it can be @Vincent
18th Jun 2017, 12:53 PM
Mugfirfauzy Siregar
Mugfirfauzy Siregar - avatar
0
not yet.. @Samuel
18th Jun 2017, 2:06 PM
Mugfirfauzy Siregar
Mugfirfauzy Siregar - avatar