What if choice1 is Paper?


#1



Hello, im kind of stuck right now with this code. I've checked thoughout and i don't think i missed any bracket, so i don't understand why my code isn't working.


What if choice 1 is Paper?


Unexpected Else token


var compare = function(choice1, choice2) {
    if (choice1 === choice2) {
        return "The result is a tie!";
    }
    else 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

Your first else-if statement (choice2==="scissors") is not complete, you need to put an if statement inside. Also the else statement is currently outside of the else-if statement. Do it like you did with the second else-if statement (choice1==="paper")