Both Choices are the Same!


#1



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

It says "Your compare function does not return 'The result is a tie!' when there is a tie."
My code:


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


#2

Huhnn... Please try browser refresh.

It looks all good.


#3

Ooops! You forgot the exclamation mark.

return "The result is a tie!";


#4

Thanks for the help!


#5

You're welcome.

Have fun coding! :slight_smile:


#6

Are you kidding me? Ah! my head hurts with such small details.


#7

It's fine :smile: :smile:


#9

Thanks so much! I made the same mistake. This looks like a design error on Code Academy's part.


#10

Not really. One just needs to be detail oriented.

Have fun coding! :slight_smile:


#11

If you look in the instructions you'll find them asking for "The result is a tie!" with the exclamation mark though in the Hint they include the phrase "The result is a tie" with no exclamation mark.

While it could be argued they did this intentionally to help users be "more detailed oriented" I think most of us would agree this is a design error...


#12

I just looked at the instruction again. It says:

Inside the function, write an if statement. If choice1 === choice2, then return "The result is a tie!"


#13

Yep, exactly. And also below the design error I mentioned is in the Hint section that unfortunately excludes the exclamation mark:

Your code should look something like this:
var compare = function(choice1, choice2) {
** if(choice1 === choice2) {**
** return "The result is a tie";**
** }**
};


#14

Okay! The hint has the inconsistency! :slight_smile:


#15

:wink: Yea! Thanks for the help, I would've been searching foreverĀ”


#16

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