0
How the fuction take a input? in python is input() or int(input()) but in JavaScript? no is there?
function main() { var distance = parseInt(readline(), 10) var distance_dv = distance/40 var result = distance_dv*60 console.log(result); }
4 Respuestas
+ 3
You can use the HTML element called 'input' to write or get values, or the javascript "prompt()"
+ 3
readLine()
which is in first line of your function
is the input method of SoloLearn Node.js type code practice.
+ 2
Thanks all for your support, I want to live of this xd, thanks ❤️❤️❤️
+ 1
It depend javascript is web language and you can take user input in few ways, mostly we use some input field in html, and read inputed data with js.
You can also use prompt() with this user will get pop up window to enter value, this is not good practice in websites, to have lot of this things, users will mostly leave from site.
Code you posted use readline() to insert testing value in code.
This is from node.js, so this command wont work in regular javascript. You can ignore this one and only remmember what it does.