Getting Did you create a function called compare?


#1

What am I doing wrong?

/*var userChoice = prompt("Do you choose rock, paper or scissors?");
var compare = function(choice1, choice2){
if(choice1 === choice2){
return "The result is a tie!";
}
};
var computerChoice = Math.random();
if (computerChoice < 0.34) {
computerChoice = "rock";
} else if(computerChoice <= 0.67) {
computerChoice = "paper";
} else {
computerChoice = "scissors";
} console.log("Computer: " + computerChoice);*/

Replace this line with your code.

`


#2

What exactly is the error you're getting?


#3

Probably the one in the title, and figuring out what's "wrong" can probably be done by testing the function and comparing its behaviour to the instructions


#4

This segment of code should follow that of the computerChoice segment (which is in comments, at present).


#5

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