Missing ) in parenthetical error, but everything seems to be closed off properly

别等时光非礼了梦想. 提交于 2019-12-02 03:49:30

问题


I'm getting the missing ) error from the following code. JS Hint says a ) is expected from the top line, but "if" found instead.

denom = (((theZombies[j].y + 15) – theZombies[j].y) * (mouseX – Player1.x) – ((theZombies[j].x + 18) – (theZombies[j].x - 18 )) * (mouseY - Player1.y));

if (denom != 0) {theZombies.splice(j, 1);}

But I don't get it -- all the parentheses are closed off properly. I've also looked back in the code and can't find an unclosed one previously. Any ideas what I'm missing?

Thanks!


回答1:


Your characters are atually U+2013 EN DASHes, which are not legal in Javascript.

You need to use U+002D HYPHEN-MINUS instead.



来源:https://stackoverflow.com/questions/18242512/missing-in-parenthetical-error-but-everything-seems-to-be-closed-off-properly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!