What if choice1 is paper?


#1

Hi guys, This looks right to me but I'm getting the output "SyntaxError: Unexpected token else"

Can anyone spot my mistake? Cookies if you can.

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 "paper wins";
}
else {
return "scissors wins";
}
}
};


#2

An else is only allowed after an if-statement. You've got 4 else's, look at what each one follows.