8.What if choice1 is scissors


#1


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

There was a problem with your syntax;SyntaxError: expected expression, got keyword 'else'


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(choice2 === "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";
            }
        }
    }
compare(userChoice, computerChoice)


#2

The syntax highlighting indicates something missing in the syntax. In this case, a missing quotation mark.

return "rock wins";

#3

I put in the quotation mark but I got the same response:SyntaxError: expected expression, got keyword 'else'


#4

There is a missing } before the last else if.


#5

Thanks that worked; great eyes