SyntaxError: Unexpected keyword 'else'


#1

I'm trying to continue with the lesson but I keep getting: SyntaxError: Unexpected keyword 'else'? I'm unsure of what I've done wrong here! Anyone help? I've tried looking on the forums but can't relate it to my 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 (choice1 === "paper") {
    if (choice2 === "rock"){
    return "paper wins"}
    else {
        return "scissors wins" }

else if (choice1 === "scissors") {
    if (choice2 === "rock"){
    return "rock wins"}
    else {
        return "scissors wins" }

}
};


#2
else if (choice1 === "rock") { // opens else if
    if (choice2 === "scissors"){ //opens if
    return "rock wins"} //closes if
    else { //opens else
        return "paper wins" } // closes else

counting brackets your else if is still open so you nest the next cases in it leading else ifs that follow else cases.