0
I just simply tried to take input using javascript as I started javascript basics, why it's not running?
2 Answers
+ 5
If you are trying to do user input use the promp function
Inside you ask what you want to ask the user in this case though im just going to make it blank
let x = prompt()
print(x)
Whatever you type in the box when you run the program will be displayed to the console
+ 5
let x = readLine();
works only in CodeCoach Sololearns compiler which is so created to do this. JavaScript does not have this statement.
Instead you can use prompt() as above mentioned or input tag from HTML.