Build "Rock. Paper, Scissors" "what if choice is rock" expected {"


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

" SyntaxError: Expected '{' "

I don't know what to do and what is wrong?


#2

You incorrectly put ";" in your conditional statements and at the start of your function. ";" means end of a sentence so JavaScript will not be expecting an open curly bracket after it. Remove the ";" after your function (choise1, choise2);, and after your conditional statements:

else if (choice1 === "rock"); /*remove the ;*/ {
    if (choice2 === "scissors"); /*remove the ;*/ {