"Your compare function does not return 'The result is a tie!' when there is a tie."


#1

In the "Both choices are the same!" part, I am writing the code exactly like given in the hint, but I repeatedly get an error message saying "Your compare function does not return 'The result is a tie!' when there is a tie."

Don't know how to fix this. Anyone facing the same issue?


#2

Have you tried adding an exclamation point at the end of "The result is a tie" ("The result is a tie!")?


#3

can you copy and paste the code you're trying to submit, please?


#4

Got it! I was missing the exclamation point! Thanks so much!


#5

I also missing the exclamation point! thanks so much.


#6

try this :smile:

*var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice < 0.34) {
computerChoice = "rock";
} else if(computerChoice <= 0.67) {
computerChoice = "paper";
} else {
computerChoice = "scissors";
} console.log("Computer: " + computerChoice);*/

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