Choice1 is not defined


#1

https://www.codecademy.com/courses/javascript-beginner-en-Bthev-mskY8/1/4?curriculum_id=506324b3a7dffd00020bf661


I continue to get this error message "RefrenceError: choice1 is not defined." Im not sure where I went wrong, or how to further define choice1.


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);

function compare(choice1, choice2){
    if (choice1 === choice2){
        return "The result is a tie!"}
    else if (choice1 === "rock"){
        if (choice2 === "scissors"){
            return "rock wins"
        }
        else{
            return "paper wins"
        }
    }
    else if (choice1 === "paper"){
        if (choic2 === "rock"){
            return "paper wins"
        }
        else{
            return "scissors wins"
        }
    }
    else if (choice1 === "scissors"){
        if (choice2 === "rock"){
            return "rock wins"
        }
        else{
            return "scissors wins"
        }
    }
}

console.log(compare(choice1, choice2))


#2

I realized that I spelled "choice1" wrong once, but even with that corrected I still get the error message.


#3

I meant "choice2" is the one that I spelled wrong


#5

You are comparing variables which are not defined. choice1 and choice2 are only names of arguments of your compare function.
You have defined userChoice and computerChoice, so you should compare these variables.