Unexpected End of Input Syntax Error please help


#1

This is my code so far and I can't seem to find whats wrong with it.
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";
        }

}

If you can find whats wrong with it thank you very much


#2

add this

    };

after the last brace to close the funtion


#3

HELP
What's wrong?
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";
}
};


#4

9th line of code
delete the curly brace before else