Unexpected End of Input



So, this seems to be a regular problem with me; it says that I have an unexpected end of input, but I can't find it, it doesn't appear to have any extra '}' or ';'. the console says
"SyntaxError: Unexpected end of input"
and the error message says
"Oops, try again. There was a problem with your syntax."

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


Neither your else if not your function have their closing } so the program expects them and therefore the end of input comes unexpected.


So my else if function is missing a }? or my else if and my function are?


Hi its missing to your compare function and to the eslse if statetement


You miss two "}" under your code. :stuck_out_tongue:


Thank you! That makes much more sense!


Thank you for your help!


Thank you for your help and how quickly you responded!


why is there another curly bracket at the end when it doesnt seem like it corresponds to another one?