Data update
This commit is contained in:
parent
72eb4943cb
commit
4d5544505c
2347 changed files with 62432 additions and 16731 deletions
21
Task/Input-loop/JavaScript/input-loop-2.js
Normal file
21
Task/Input-loop/JavaScript/input-loop-2.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
const readline = require("readline");
|
||||
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout
|
||||
});
|
||||
|
||||
function askQuestion(query) {
|
||||
return new Promise(resolve => rl.question(query, resolve));
|
||||
}
|
||||
|
||||
async function main() {
|
||||
while (true) {
|
||||
const input = await askQuestion("Type something: ");
|
||||
// do whatever you want with the input string
|
||||
// remember to break the loop if you need
|
||||
}
|
||||
rl.close();
|
||||
}
|
||||
|
||||
main();
|
||||
Loading…
Add table
Add a link
Reference in a new issue