【问题标题】:I want score attained by user我想要用户获得的分数
【发布时间】:2021-09-20 20:18:44
【问题描述】:

我必须在我的测验中获得用户分数。这里是链接 https://replit.com/@ArpitKumar9/quiz-1#index.js

【问题讨论】:

标签: node.js repl.it


【解决方案1】:

您使用的这个软件包似乎有问题。 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();
});

【讨论】:

  • 我想在这段代码中添加选项。链接如上所示
猜你喜欢
  • 2020-02-11
  • 1970-01-01
  • 2018-05-28
  • 1970-01-01
  • 1970-01-01
  • 2013-03-12
  • 2011-08-06
  • 1970-01-01
  • 2023-02-21
相关资源
最近更新 更多