Getting Did you create a function called compare?


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.



What exactly is the error you're getting?


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


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


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