Help me please. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Help me please.

What's wrong with my code that SoloLearn doesn't admit it for the JS Trip planner challenge? const distance = Number(prompt()); const main = function () { let time = distance /40 * 60; return time; }; const timeInMinute = main(); console.log(timeInMinute); It's properly working on ma computer, but not in here!

31st Dec 2020, 3:50 PM
Saleh Ghazimoradi
Saleh Ghazimoradi - avatar
3 Answers
+ 1
Saleh Ghazimoradi don't worry about Node.js syntax. Node.js is a JavaScript runtime environment that executes JavaScript code outside of a web browser. In Javascript course module, you won't need to write the Node.js syntax. If some Node.js syntax is required, then it will be already available in the code tab of challenge. You just need to write the javascript logic below the //your code goes here comment line.
31st Dec 2020, 5:03 PM
Art1mis
+ 4
The code tab in trip planner challenge uses Nodejs to test your code. Using Number(prompt()) might not work. This code might help you. function main() { var distance = parseInt(readLine(), 10); //your code goes here const speed = 40 const time = distance/speed const timeInMinutes = time * 60 console.log(timeInMinutes) }
31st Dec 2020, 4:08 PM
Art1mis
+ 3
Art1mis Thank ya pal. 🙏🌹🌹🌹🙏 What if a person doesn't know Node.js! It doesn't make sense at all. I have no idea how I must handle the challenges to get ma new certification. 😒
31st Dec 2020, 4:53 PM
Saleh Ghazimoradi
Saleh Ghazimoradi - avatar