+ 1

Why isn't my code working

function main() { var distance = parseInt(readLine(), 10); //your code goes here var hour = distance / 40 var minutes= hour *60 document.write( minutes +"minutes"); }

30th Dec 2021, 7:24 AM
Ace Coder
Ace Coder - avatar
4 ответов
+ 3
As far I can see d is not defined h is also not defined assuming it to be nodejs in sl playground document.write should be replaced with console.log
30th Dec 2021, 8:19 AM
Atul
Atul - avatar
+ 2
Ace Coder are you trying to solve javascript lesson module trip planner? if yes then change document.write to console.log and remove that "+minutes" the sample output does not contain it!
30th Dec 2021, 9:59 AM
Atul
Atul - avatar
+ 1
Inumaki thanks it worked
30th Dec 2021, 10:22 AM
Ace Coder
Ace Coder - avatar
0
Inumaki How about now
30th Dec 2021, 9:55 AM
Ace Coder
Ace Coder - avatar