//Make sure you have Node and NPM installed
//Run "npm install prompt-sync" in the terminal
const prompt = require('prompt-sync')();
const name = prompt('What is your name?');
console.log(`Hey there ${name}`);
//Make sure you have Node and NPM installed
//Run "npm install prompt-sync" in the terminal
const prompt = require('prompt-sync')();
const name = prompt('What is your name?');
console.log(`Hey there ${name}`);
--------------- easiest method I found---------------------------
Run npm install prompt-sync in the terminal
const prompt = require('prompt-sync')();
var name = prompt('what is your name?');
console.log(name);
--------------------------------------------------------------
--------------- easiest method I found---------------------------
Run npm install prompt-sync in the terminal
const prompt = require('prompt-sync')();
var name = prompt('what is your name?');
console.log(name);
--------------------------------------------------------------
// Importing the module
const readline = require("readline-sync");
// Enter the number
let a = Number(readline.question());
let number = [];
for (let i = 0; i < a; ++i) {
number.push(Number(readline.question()));
}
console.log(number);
// Importing the module
const readline = require("readline-sync");
// Enter the number
let a = Number(readline.question());
let number = [];
for (let i = 0; i < a; ++i) {
number.push(Number(readline.question()));
}
console.log(number);
// first install prompt-sync:
// npm install prompt-sync
const prompt = require("prompt-sync")({ sigint: true });
const age = prompt("How old are you? ");
console.log(`You are ${age} years old.`);
// first install prompt-sync:
// npm install prompt-sync
const prompt = require("prompt-sync")({ sigint: true });
const age = prompt("How old are you? ");
console.log(`You are ${age} years old.`);