Why I get only NaN as output - greenhorn needs help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Why I get only NaN as output - greenhorn needs help

//route planer function main() { var distance = parseInt(readLine(),590); //your code goes here var hour_tour = distance / 40; var min_route = hour_tour * 60; console.log (min_route); } Thank you

25th Feb 2021, 6:33 PM
Thilo Ostkamp
Thilo Ostkamp - avatar
3 Answers
+ 2
why did you have modified the second argument of parseInt? it should be stick to 10, not 590 (invalid base so that's why you get NaN as input and therefore NaN with any calculation ;P)
25th Feb 2021, 6:52 PM
visph
visph - avatar
+ 1
What is "590"?? It should be 10 . And please use language name as tag .
25th Feb 2021, 6:55 PM
Abhay
Abhay - avatar
0
thank you very much 👍
6th Mar 2021, 6:33 PM
Thilo Ostkamp
Thilo Ostkamp - avatar