+ 1

why javascript has no lessons about input?

i have completed 30 lessons and 3 projects and still dont know how to create input. i have meet it in other lessons but dont know how its works

31st Jan 2022, 6:39 PM
nikoloz kherkeladze
nikoloz kherkeladze - avatar
4 odpowiedzi
+ 2
Not completed a lesson of pop-up boxes? Revise lesson of prompt box in js https://www.sololearn.com/learn/javascript/1149/?ref=app
31st Jan 2022, 7:28 PM
Jayakrishna 🇮🇳
+ 2
Not sure but As far I know, this runs in node.js and readLine method is from node.js API Node.js has an API called readline that lets JavaScript programs read input from the command line.. You can check that, this program not support in sololearn's JavaScript, but works in node.js (if sololearn installed readline API)..
31st Jan 2022, 8:39 PM
Jayakrishna 🇮🇳
+ 1
Jayakrishna🇮🇳 i've done this lesson yes but i mean not that inputs. for exsample: function main() { var num1 = parseInt(readLine(),10); var num2 = parseInt(readLine(),10); var num3 = parseInt(readLine(),10); var average; average = avg(num1,num2,num3); console.log(average) } function avg(num1 ,num2 ,num3){ var average = (num1 + num2 + num3)/3; return average}; i'm talking about that inputs like var num1 = parseInt(readLine(),10); there is no lesson that explains this inputs. this code is from one of the practice lessons.
31st Jan 2022, 7:41 PM
nikoloz kherkeladze
nikoloz kherkeladze - avatar
+ 1
This is used for testing our code in challange, you can look on internet about readLine(), node.js have module for readline. parseInt is part of javascript and you can read more here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt
31st Jan 2022, 9:36 PM
PanicS
PanicS - avatar