" SyntaxError: Unexpected token {" What if choice1 is rock need help please!


#1

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


Replace this line with your 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";
        }
        
    };

compare ("paper", "paper");


#2

You're missing one more curly brace at the end for your else if.

Also,

You should close that function parameter with )

I hope this helps! :wink:


#3

wooooowww Ugh that irritates me lol


#4

Haha... Keep at it and you will only get better. :wink:


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.