Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var readline = require('readline');
- var rl = readline.createInterface({
- input: process.stdin,
- output: process.stdout
- });
- rl.question("What do you think of node.js? ", function(answer) {
- console.log("Thank you for your valuable feedback:", answer);
- rl.close();
- });
- var readline = require('readline');
- var rl = readline.createInterface({
- input: process.stdin,
- output: process.stdout
- });
- var fav_foods = [];
- var ask_question = function() {
- rl.question("What is your favourite food? ", function(answer) {
- fav_foods.push(answer)
- fav_foods.forEach(function (element) {
- console.log("Your favourite food is " + element)
- })
- ask_question()
- });
- }
- ask_question()
Add Comment
Please, Sign In to add comment