5. Both choices are the same!


Hello guys,
i always get the error message below.

Oops, try again. Your compare function does not return 'The result is a tie!' when there is a tie.

If i dont misunderstand the instruction, the upper could has to be commented.
So of course there is no possibilty the code can output "The result was a tie"
What am i doing wrong?

/*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(compare);*/

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


Make sure your text exactly matches what is in the instructions


Unbelivable. Wasted over a half our searching for my error.
Thank you very much!


Believe me, we're all going through the same thing :slight_smile:


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