Debugging help with 8. What if choice1 is scissors?


#1

Hello and thanks for your help. I am having trouble finding my error on this one. I have searched through the QA Forums, without any luck. Below is my code. The error is:
SyntaxError: Expected '{'
code below:

var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice < 0.34)
{
computerChoice = "rock";
}
else if (computerChoice <= 0.67)
{

        computerChoice = "paper";
}
else 
    {
	computerChoice = "scissors";
    }
console.log("Computer: " + computerChoice);
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";
    }
}
else if (choice1 === "paper")
{
    if (choice2 === "rock")
    {
        return "paper wins";
    }
    else
    {
        return "scissors wins";
    }
}
else if (choice1 === "scissors")
{
    if (choice2 === "rock")
    {
        return "rock wins";
    }
    else
    {
        return "scissors wins";
    }
}
}
compare(userChoice, computerChoice);

#2

Take a look at how they declare a function here - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function.

You've just got a semi-colon after the parameters of your compare function that shouldn't be there. So the computer is expecting a { but sees the ; instead and says something is wrong.


#3

ahhh, the ever elusive semi-colon. I appreciate the linked resource. Thank you for your help!