7/9 syntax error


#1

compare(userChoice, computerChoice)

var compare = function(choice1, choice2) {
if(choice1 === choice2) {
return "The result is a tie!"
}

else if(choice1 === "paper") {

    if(choice2 === "rock") {
        return "paper wins"
    }
    else {
        return "scissors wins"
    }

else if(choice1 === "rock") {

    if(choice2 === "scissors") {
        return "rock wins"
}
else {
    return "paper wins"
}

}}

I don't know what is wrong ;-;


#2

compare(userChoice, computerChoice)  // Add Semicolon
var compare = function(choice1, choice2) {
 if(choice1 === choice2) {
 return "The result is a tie!" // Add Semicolon

 }
 else if(choice1 === "paper") {
    if(choice2 === "rock") {
        return "paper wins" // Add Semicolon

    }
    else {
        return "scissors wins" // Add Semicolon

    }
 //MISSING A CLOSING BRACKET ON THIS LINE!!
else if(choice1 === "rock") {

    if(choice2 === "scissors") {
        return "rock wins" // Add Semicolon

}
else {
    return "paper wins" // Add Semicolon
}

}}

#3

I would also say put:

compare(userChoice, computerChoice);

At the END of your code, not the beginning. Just so it knows that the function exists before you call it :smiley: