What if choice1 is rock? (Help plz)


#1



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


It keeps giving me: Oops, try again. There was a problem with your syntax.
Please Help.


function compare(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!";"
   }
}


#2

this line:

return "Paper wins!";"

3 quotation marks (")? Not sure that will work


#3

I've removed it, but its still having syntax errors.


#4

your function opening curly bracket ({) doesn't have a matching closing tag (})


#5

Ah, It works!
Thank you! :sweat_smile: