Why isn't my code working | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 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 Antworten
+ 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
Shino
Shino - 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
Shino
Shino - 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