Rock Paper Scissors


#1

var userChoice = prompt("Rock,Paper or scissors?");
var computerChoice = Math.random();
if (computerChoice < 0,34) {
computerChoice = ("Rock");
}
else if (computerChoice < 0,67) {
computerChoice = ("Paper");
}
else {
computerChoice = ("Scissors");
}
console.log("Computer: " + computerChoice);
var compare = function(choice1,choice2) {
if (choice1 === choice2);
return "The result is a tie!";
}
else if (choice1 === "Rock") {
if (choice2 === "Scissors");
return "Rock wins";
}
else {
return "Paper wins";
}
else if(choice1 === "Paper") {
if (choice2 === "Rock");
return "Rock wins";
}
else {
return "Scissors wins";
}
else if (choice1 === "Scissors") {
if (choice2 === "Paper");
return "Sciccors wins";
}
else {
return "Rock wins";
}

SyntaxError: Unexpected token else


#2

Seems like your missing closing } for the else ifs.