Exercise 5 help please!


#1

I can not find where in my code is the error.

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

The error message i get is:
Oops, try again. Did you create a function called compare?


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



#2

Look at how you spelled choise1 in your parameters, and choise2 in your if statement. They’re spelled incorrectly. Also, there’s a semicolon (;) that’s making your if statement not execute. Do you see the problem? :slight_smile:


#3

oh my god how stupid am i!spelled choice wrong…thanks!!


#4

But still when i change that the error message is:

Oops, try again. There was a problem with your syntax.

Now my code looks like this:

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


#5

No, your first code was just fine (with correct spelling). You just needed to remove the semicolon. Do you know what I mean?


#6

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