-4

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?

2 Answers2

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.

General Grievance
  • 4,555
  • 31
  • 31
  • 45
Godfather
  • 5,711
  • 5
  • 21
  • 27
-1

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,471
  • 15
  • 32
  • 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