5. Both choices are the same!


#1

5 Both choices are the same!

Stuck! What am I doing wrong? I keep getting the below error message:
SyntaxError: Unexpected EOF

 

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


#2

Hi @improviser14,

In short, you're missing the closing double quote at the end of the string you are returning.

Please see the sample below:

var compare = function(choice1, choice2) 
{
    if(choice1 === choice2) 
    { 
        return ("The result is a tie!");   //add double quote here I simply added parens due to my own style
    }
};

#3

Thank you! I overlooked it so many times that it became a fixture!


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.