'Build "Rock, Paper, Scissors" (5. Both choices are the same!)


Hi I have been having trouble with my syntax, and I cannot figure out what is wrong.
This is my code...

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

If someone could please tell what is wrong, it would be much appreciated.


HI try to add ! after tie like that

return "The result is a tie!";


Thank you so much,
that was a stupid mistake on my part.


It's ok. Everyone makes mistakes.


error are come in if statment how to solve this problem.


Hi you should post your code or create new topic with your code.


Thanks for your help. I was stuck in the same place and the ! helped me out.


i have a problem message:
Oops, try again.
Your compare function does not return 'The result is a tie!' when there is a tie.
my code is:
var compare=function(choice1,choice2){
if(choice1 === choice2){
return"the result is a tie!";


Hi this

return "the result is a tie!"

should be like that

return 'The result is a tie!'

with the uppercase T


Their example actually shows it without the exclamation point on the hint below.


Sorry to bother everyone, but I really don't know what is wrong with my syntax:

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


Try removing the space before the semi-colon and see if it works? :wink:


Thank you for your reply. yeah i tried it again, there is something wrong with the semicolon. I mistakenly used ";" instead of ";"

Thanks again.


Aii... You're welcome.

Have fun coding! :slight_smile:


Yo don't worry. The hint doesn't display the "!" either


Hi. You don't need the semicolon after Return to pass. Here is mine:
var compare = function(choice1, choice2){
if (choice1 === choice2){
return "The result is a tie!"
At least there is no problem passing on my laptop.