Unexpected End of Script?


#1

I'm doing the rock paper scissors lesson 6 and every time I try to submit, it says SyntaxError: unexpected end of script. Here is my code:

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

I've ran it through JSHint and it comes up with unexpected end of script. I don't know what is wrong because I ended the code with }. Pls tell me what is wrong.

Thanks


#2

You're missing a closing bracket at the end of your code, make sure you match up all of your opening brackets to your closing brackets. I hope this helps!