【发布时间】:2021-09-20 20:18:44
【问题描述】:
我必须在我的测验中获得用户分数。这里是链接 https://replit.com/@ArpitKumar9/quiz-1#index.js
【问题讨论】:
-
您需要在此处在您的问题中发布minimal reproducible example,并在任何其他网站上发布not a link。
我必须在我的测验中获得用户分数。这里是链接 https://replit.com/@ArpitKumar9/quiz-1#index.js
【问题讨论】:
您使用的这个软件包似乎有问题。 Node.js 有一个内置的 readline 核心模块: nodejs.org/docs/latest-v12.x/api/readline.html
你最好改用它。
节点文档摘录:
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question('What do you think of Node.js? ', (answer) => {
// TODO: Log the answer in a database
console.log(`Thank you for your valuable feedback: ${answer}`);
rl.close();
});
【讨论】: