0

AMATEUR, JS

ok bros, i am just startin in js i don have a idea for this...I need to do a function that converts the miles into hours and the hours into minutes i tried this: function main(){ var distance=parseInt(readLine(),10) //your code goes here var hours=distance/40, var minutes=hours*60 } console.log(main()); And this function main(){ var distance=parseInt(readLine(),10) //your code goes here var hours=distance/40, var minutes=60, var result=hours*minuts; } console.log(main()); well, nothing comes to mind.. please dont kill me

12th Aug 2021, 11:27 PM
juan esteban valencia
juan esteban valencia - avatar
1 Odpowiedź
+ 3
40 is speed? You console log function result, so you need to add return statement in your function.
13th Aug 2021, 12:44 AM
Gordon
Gordon - avatar