Whatā€™s wrong with this code? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Whatā€™s wrong with this code?

function main() { var distance = parseInt(readLine(), 10); var mph = hours = distance/mph minutes = hours * 60 document.write(minutes) } the code above has something wrong with it. It does not give me an output. Why is that?

28th Feb 2021, 2:58 AM
ā™„ KimWooBin Lover ā™„
ā™„ KimWooBin Lover ā™„ - avatar
3 Respostas
+ 5
You missed to define the variable mph as 40. Also you need to get the output in console. So, You have to use console.log instead of document.write
28th Feb 2021, 4:47 AM
Simba
Simba - avatar
+ 2
thank you Simba
28th Feb 2021, 4:49 AM
ā™„ KimWooBin Lover ā™„
ā™„ KimWooBin Lover ā™„ - avatar
- 1
Specify your problem. Please.
28th Feb 2021, 3:24 AM
Daniel BriceƱo
Daniel BriceƱo - avatar