6/9 Build "Rock,Paper,Scissors"


#1

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

}

What I get after pressing Save & Submit Code
SyntaxError: Unexpected token else
Where is the problem?


#2

else can't follow immediately after a function

Make sure to test that your first if-statement is working as it should before you move on, looks like you might miss a bug there if you don't.


#3

on line two: delete the semi-colon at the end. enter this ( { ) curly bracket instead.
on line three: you need semi-colon. just like they way you have it on line 7.