【问题标题】:I am trying to create a calculator by displaying the number clicked我正在尝试通过显示单击的数字来创建计算器
【发布时间】:2022-06-10 23:05:26
【问题描述】:

If (output != Nan) {
  output = output + this.id;
  PrintOutput(output)

为什么这段代码没有运行

【问题讨论】:

  • 对于初学者来说,它有语法错误。 If 应该是 if(JavaScript 区分大小写)并且代码块永远不会用 } 关闭。除此之外,您也永远不会定义outputPrintOutput,也不清楚this 是指什么。您的浏览器的调试控制台会告诉您这些错误。 总是先检查那里。

标签: javascript


猜你喜欢
  • 1970-01-01
  • 2022-06-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-05-12
  • 1970-01-01
相关资源
最近更新 更多