0

Pls, help me this code. Why is nothing being output to console.

function main() { var distance = parseInt(readLine(), 10); var speed=40; var time=(distance/speed)*60; console.log=(time); }

26th Apr 2021, 5:51 PM
Vladimir Kushner
Vladimir Kushner - avatar
4 Antworten
+ 3
There is no console.log= console.log is a function so it should be write like this console.log(time);
26th Apr 2021, 6:36 PM
A͢J
A͢J - avatar
+ 2
Привет! = в консоль лог надо бы удалить...
26th Apr 2021, 6:02 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 2
спасибо друзья !
26th Apr 2021, 8:38 PM
Vladimir Kushner
Vladimir Kushner - avatar
+ 1
No need to "=" sign if the main function didn't declare anywhere(as in onclick, or onsubmit), so call it as main()
27th Apr 2021, 2:58 PM
🇮🇱 Radin Masiha 🇮🇱
🇮🇱 Radin Masiha 🇮🇱 - avatar