It says I have a Syntax error, but idk what it is


#1



var compare = function(choice1, choice 2)
if (choice1 === choice2){
                    return "The result is a tie!";
}
else if (choice1 === "rock"){
    if (choice2 === "scissors"){
        return "rock wins";
    }
    else {
        return "paper wins";
    }
}

It says I have a sytax error but i don't know what it is

Replace this line with your code.


#2

normally when you have a function:

var testFunction = function(){
  // do something
}

your function has curly brackets {} to indicate the start and finish of the function. Those are just missing in your code