Help // 5. Both choices are the same!


#1

I can't found where my error is, can someone help me, please.
That's my code:

/*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 === choise2) {
return "The result is a tie!";
}
};

as an error I get:

Oops, try again. Did you create a function called compare?


#3

First use this way to format your code:


it is probably less work and is better readable as > is for indented text not code.

choise2

should probably be choice2 even though that doesn't seem to be related to the error.
PS: Maybe the author was over thinking it and as he doesn't got the correct result from your code he anticipated that something is wrong with your function... Still not optimal.


#4

So what I am supposed to do now ? ;d


#5

you have a typo of choice2 in the compare section


#6

OMG...
Thanks a lot mate ;ddd