1
var userChoice = prompt("Do you choose rock, paper or scissors");
var computerChoice = Math.random();
if (computerChoice <= .33) {
computerChoice === "rock";
}
else if (computerChoice <=.66){
computerChoice === "paper";
}
else (computerChoice <= 1) {
computerChoice === "scissors";
};
console.log(computerChoice);
SyntaxError: Unexpected token '{'. Parse error
首先,错误意味着你有一个{它不是预期的。我认为这是因为你的小数没有前导零。 – Chet