首先,标题这么长我也没办法.
这次发现这个网站的js教程的”Program your first game!”章节的5/7(now/all)有错误.
导致我花了半个小时都没通过.
后来在其论坛上发现正解.

教程说明:

The story heats up!

Now you have to create different scenarios. Good thing we know how to do that using if / else statements.
If userAnswer is “yes”, print out: “You and Bieber start racing. It’s neck and neck! You win by a shoelace!”
Otherwise, print out: “Oh no! Bieber shakes his head and sings ‘I set a pace, so I can race without pacing.'”
Remember: = is for assignment, and === is to check if things are equal!

你需要做的事:

Use an if / else statement to write out the last part of this game!
Make sure to check the console for error messages and suggestions for how to fix them.

我写的js是:

1
2
3
4
5
6
7
8
var userAnswer=prompt("Do you want to race Bieber on stage?");
if(userAnswer==="yes"){
    console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!");
}
else
{
    console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
}

然后死活不通过,正解:

1
2
3
4
5
6
7
8
var userAnswer=prompt("Do you want to race Bieber on stage?");
if(userAnswer==="yes"){
    console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!");
}
if(userAnswer!=="yes")
{
    console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
}

浪费我半个小时时间,最蛋疼的是除非一个个任务通过,不然就无法达成成就,成就控慎入.