Unexpected token else Error


#1

I don't see what mistake I made. here's my code:

    /*var userChoice = prompt("Do you choose 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 "Paper wins"
        }
        else {
            return "Scissors wins"
        }
    }
};

here is my error:

SyntaxError: Unexpected token else

Please tell me if you spot the error.


#2

right before this line

    else if (choice1 === "paper")

you have to close the else if block the comes before

    }
    else if (choice1 === "paper")

#3

I realised that after I posted this. Thanks for trying to help, though!