Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 涉及“的错误”;否则,如果;和缺少的操作数_Javascript - Fatal编程技术网

Javascript 涉及“的错误”;否则,如果;和缺少的操作数

Javascript 涉及“的错误”;否则,如果;和缺少的操作数,javascript,Javascript,我正在用JavaScript制作一个choose you own冒险风格的游戏,在本节中: evade = prompt("Go out of your way to avoid them, just in case? (y/n)"); if(evade = "y"); { alert("Even though you went well out of your way and changed course multiple times,the two men are still with

我正在用JavaScript制作一个choose you own冒险风格的游戏,在本节中:

evade = prompt("Go out of your way to avoid them, just in case? (y/n)");
if(evade = "y");
{
  alert("Even though you went well out of your way and changed course multiple times,the two men are still with you.");        
  alert("Your stalkers have kept the same pace and distance the entire time but do not  seem to be interested in confrontation.");
 }
else if(evade = "n"); {
  alert("the two men have caught up with you.");
  alert("as you turn the corner, they sweep you off your feet and stab you");
  alert("you are dead");
}

我在第9行发现了错误“缺少操作数”(否则,如果(逃避=“n”);{),我无法找出它。请帮助!

在比较中使用
=
=
只是一个赋值


然后不要在你的
if
else if

后面加
,在比较中使用
=
=
只是一个作业。然后不要在
if
else if
后面加
,谢谢!这解决了问题problem@ced-b-你应该回答这个问题,然后做手术在其他人之前接受它:)只有在游戏的这一部分你才会遇到这种问题?它还处于非常早期的部分,这是一段很好的代码,所以,是的