JavaScript给出无意义的错误

JavaScript给出无意义的错误,javascript,Javascript,所以,我和几个朋友正在用JavaScript进行文本冒险。其中,玩家有可能使用治疗法术,该法术运行以下代码: function heal() { alert('You chant some ominous-sounding words, and your wounds heal'); alert('Hit points restored!'); hitPoints += 60; blobsOfDoom -= 30; burn(); MonsAtt(); Choose

所以,我和几个朋友正在用JavaScript进行文本冒险。其中,玩家有可能使用治疗法术,该法术运行以下代码:

function heal() {
  alert('You chant some ominous-sounding words, and your wounds heal');
  alert('Hit points restored!');
  hitPoints += 60;
  blobsOfDoom -= 30;
  burn();
  MonsAtt();
  Choose Spell();
}
错误消息: 火狐: 铬:
语法错误:意外标识符


为什么会出现这个错误?如何修复它?

函数中不能有空格

Choose Spell();

检查您的函数声明中的ChooseSpell和任何其他事件,并将它们更改为有效的函数名,如
ChooseSpell()

ChooseSpell()
p.S。请将其重命名为
ChooseSpell()。另一方面,代码…/me掷骰子,我也会说错误消息非常清楚。你读过JavaScript参考吗?我想知道人们如何尝试使用标识符名称中的空格。这在我所说的任何语言中都是无效的,而且通常在参考手册的第一章就有描述。
Choose Spell();