I know Js can be used in nodejs as a server scripting language.It can also be used to manipulate data in a html file,but how can we use a scanf/cin option in JS?
Asked
Active
Viewed 370 times
2 Answers
0
You can use readline api or process api for it with node.js. Refer the node.js documentation for more info.
Luke P. Issac
- 1,333
- 14
- 31
-
Can you paste the code and refer. http://stackoverflow.com/questions/20086849/how-to-read-from-stdin-line-by-line-in-node – Luke P. Issac Aug 21 '16 at 17:51
0
In depends on the environment in which javascript is running, if it is nodejs you can easily find a way to read from standard input from nodejs documentation, However if it browser, then only way of input is from the input fields.
If this answer helped you, please mark it as accepted
Godfather
- 5,421
- 5
- 20
- 27