I saw this for lots of other languages but not JavaScript.
I\'m trying to do problems like: this (codechef.com) and of course the programs need to be able to read
If you use node to act as an interpreter in the terminal, you can use this:
---- name.js ----
var readline = require('readline');
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question(">>What's your name? ", function(answer) {
console.log("Hello " + answer);
rl.close();
});
----- terminal ----
node name.js