javascript console input
//SpiderMonkey
var input = readline();
//Vanilla javascript
var input = prompt("Enter input:");const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question("What is your name ? ", function(name) {
rl.question("Where do you live ? ", function(country) {
console.log(`${name}, is a citizen of ${country}`);
rl.close();
});
});
rl.on("close", function() {
console.log("\nBYE BYE !!!");
process.exit(0);
});
Also in JavaScript:
- how to write img jsx
- javascript remove object key
- aktuelle session id auslesen jsf
- javascript get index of object with value in array
- split a message js
- sqrt javascript
- transformorigin gsap
- js redirect to url
- how can prevent morgan to work in test enviroment
- remove duplicates from array of objects javascript
- angular how to copy text with button
- are you sure you want to proceed click ok button javascript code
- escape in javascript
- how to run method in method vue js on load
- length of array javascript
- react router dom npm
- string to boolean javascript
- js select element by css selector
- javascript find a digit in str
- How do you wait for 5 seconds in JavaScript?
- javascript to help find overflow elements
- redondear de 0.05 en 0.05 javascript
- send json post ajax javascript
- switch new date getday javascript