SyntaxError:意外的令牌其他(我在代码中找不到错误)

时间:2015-03-23 01:35:09

标签: javascript if-statement syntax-error

我收到语法错误,我不知道自己做错了什么。我已经缩小了这个代码可能出现的错误,但是在它之后它确实是朦胧的。我很确定它与最后的其他事情有关。 (我是初学者,如果这是一个非常容易的错误,那就很抱歉。)

if(finishAnt == "yes") {
                console.log("congratulations you have killed the aint eater!")   
            }
            else if(finishAnt == "no") {
                console.log("You run away and barley make it, you are badly hurt");
                } else {
                    console.log("sorry thats not an option")
                }
            }

1 个答案:

答案 0 :(得分:0)

您还有一个}

正确

if(finishAnt == "yes") {
   console.log("congratulations you have killed the aint eater!")   
}
else if(finishAnt == "no") {
    console.log("You run away and barley make it, you are badly hurt");
} else {
    console.log("sorry thats not an option")
}