-5 javascript
只是执行codecademy课程,当我运行代码时,一切都有效,除了这个if/else语句.当它到达那个时,无论我为userAnswer提示输入什么,我只是得到'if'输出.有人可以解释原因吗?一直在读这个东西100x,答案不是跳出来的.万分感谢.
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.'")
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
119 次 |
| 最近记录: |