SyntaxError: expected expression, got ';'


#1

hello.
I have a second problem with my exercise:

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

After clicking on "Save & Submit Code" I get this error message: SyntaxError: expected expression, got ';'

I can't find the mistake. Where is it?
Can you help me, please?


#2

On line 1. You don't need to end a function declaration with a semicolon.


#3

You shouldn't need that semicolon after that close bracket :slightly_smiling:


#4

oh, yes, now I noticed.:confused:
thanks to everyone :sweat_smile: