Having trouble with Rock, Paper, Scissors


#1

Having trouble with some syntax on rock paper scissors, any help would be greatly appreciate. Thanks!

I just keep getting this error message...

Oops, try again. There was a problem with your syntax.

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";
    }
}

#2

It would see you have 5 { but only 4 } try adding a } to balance it out!


#3

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