I'm trying to get user input, save it to a variable and do other stuff with it, but the readline function is not working the way I'm intending.
here is my code:
var readline = require('readline')
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
var response
rl.question("Enter a number ", function (answer) {
response = answer
rl.close();
});
console.log('The user entered: ', response)