What if choice1 is paper? - Help!


#1

Could someone help me with this 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";
}
}
}

It says Syntax Error: Unexpected token else.

Thanks!


#2

}{

Not sure what's going on with that line of brackets.

Check your opening and closing brackets, make sure they add up to their opening brackets


#3

I still can't see the mistake! I'm pretty sure they're adding up properly though I could be wrong.