If choice one is rock


#1

Hey i dont know whats wrong with my code, i get an "unexpected token" error

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

I guess the problem is that you need to get rid of the semicolons after your conditions. Here is an explanation why this is or might be a problem:

Also if you check your {} you can see that:

    var compare = function(choice1, choice2){
        if(choice1 === choice2); {
        return "The result is a tie";
        }
    }

this is your whole function but as you want to check for more than the tie case you need to put the other stuff in here as well.