Says compare function not created


#1

Whats wrong with this code, it says compare function not created when the code is submitted.

/*var userChoice = prompt("Do you choose rock, paper or scissors?");
var compare=function(choice1,choice2)
{
if(choice1===choice2)
{
return "The result is a tie!";
}
}

console.log(compare("paper","paper"));

var computerChoice = Math.random();
if (computerChoice < 0.34) {
computerChoice = "rock";
} else if(computerChoice <= 0.67) {
computerChoice = "paper";
} else {
computerChoice = "scissors";
} console.log("Computer: " + computerChoice);*/


#2

You need to remove /* */ because you code will be treated as a comment. Your code should look something like this.

/*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!";
}
};


#3

Thank you so much for the help...