5/9 Error "Your compare function does not return 'the result is a tie!'"


#1

Help! I keep getting this error and cannot figure out why--- any ideas?

Here is my code:

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


#3

"The result is tie!"

"The result is a tie!"


#4

Fixed the grammar! :smile: Still getting the error though :frowning:


#5

Try to change The with the.


#6

tried it :frowning: still nothing.

new code with proper grammar:

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


#7

Show a snapshot :confused:


#8


#9

"The result is a tie!" works when I try it.


#10

We've the same code. Try refreshing the page.


#11

it worked! thanks everyone :smiley:


#12

I have the same problem but refreshing the page doesn't help.
Maybe I can't see the error because I stared at the page for too long?? XD


#13

Add the "!" in the end "The result is a tie!"


#14

Thanks for the help. guys.


#15

Ok, now it works, thanks a lot!
I checked the hint and there was no "!" - should have c&p the sentence from the instructions :stuck_out_tongue:


#16

thank you... it helped me too


#17

I have the same code:

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

, but it keeps saying "unexpected end of script". Then when I take away the { }'s it says "unexpected keyword: if. Expected a "{" at the start of a function body.


#18

Hi you missing a in your return

return "The result is a tie!"