What if Choice1 is paper?


#1

I'm really not sure what is wrong here. It says it is a syntaxerror: unexpected token else, but I am not seeing it. Here is the code:

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";
}
};

};
compare(userChoice, computerChoice);


#2

You need an extra closing curly bracket there at the end.