这是代码:
var compare = function (choice1, choice2) {
if (choice1 === choice2) {
return ("The result is a tie!");
} else if (choice1 = "Rock") {
if (choice2 = "Scissorsr") {
return "rock Wins!";
} else if (choice2 = "Paper") {
return "paper Wins!";
}
} else if (choice1 = "paper") {
if (choice2 = "Rock") {
return "paper wins";
} else if (choice2 = "Scissors") {
return "scissors wins!";
}
}
};
我在 codecademy 中学习 java 脚本,提交代码后,我收到错误消息
将纸张与岩石进行比较时,您的比较函数不会返回正确的字符串。