请问哪里错了?运行结果怎么总是否定语句

请问哪里错了?运行结果怎么总是否定语句
console.log("Suddenly,Bieber stops and says,'Who wants to race me?'")
var userAnswer = prompt
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.'")
}
hhsde 1年前 已收到1个回答 举报

龙泽秀明8 幼苗

共回答了21个问题采纳率:90.5% 举报

console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'")
// prompt写了两次
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年前

10
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 16 q. 1.936 s. - webmaster@yulucn.com