What's wrong with my code? Please help


#1


https://www.codecademy.com/courses/javascript-beginner-en-Bthev-mskY8/1/1?curriculum_id=506324b3a7dffd00020bf661#


I've retyped this several times and it even looks like the code given in the hint but for some reason when I try to run it I get the message
"Oops, try again. Your compare function does not return 'The result is a tie!' when there is a tie."
I'm not sure what I'm doing wrong, any help would be greatly appreciated!

Edit: I found the answer, I didn't have the exclamation mark after the word 'tie' xD

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


#2

Your string is slightly different, so like it says, you don't return the described string


#3

Thanks yea I spent about half hour until i saw I'd missed the '!' at the end :smiley: Good times.


#4

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