Unexpected Token Else


#1



https://www.codecademy.com/en/courses/javascript-beginner-en-Bthev-mskY8/1/3?curriculum_id=506324b3a7dffd00020bf661


Unexpected Token Else


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


#2

This part it messed up. Remove if (choice2 === "paper"){ at the bottom and remove the { after else in the next line. The reason is there are only three possible outcomes when (choice1 === "rock").

In the first part of this lesson you have already said:
if (choice1 === choice2)
{
return "The result is a tie!";
}
Meaning that one of the three possibilities has been checked. When you add
if ( choice2 === "scissors")
{ return "rock wins";
}
That takes out the second possible outcome. That leaves you with only one left and you don't have to define it by adding another if statement. You just use else because it's the only other thing that can happen. I hope that makes sense.

Here you need to remove if (choice2 === "scissors") { including the { and just replace it with else.
Same story here.