The arguments of my function are choice1 and choice2, but it's telling me to call the function with computerChoice and userChoice


It does everything right in console, but it says to call the "compare" function with "computerChoice" and "userChoice" as arguments, even though it says in this exercise that the arguments should be choice1 and choice2.

All other related topics on this problem say that it has something to do with global vs. local variables, but I don't know how or why: if I set the arguments of a function as (choice1,choice2) why am I being told to call the function by passing it (computerChoice,userChoice) arguments!?

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!"}
else if (choice1==="rock")
if (choice2==="scissors") {return "rock wins"} else {return "paper wins"}

else if(choice1==="paper")
{return "paper wins"}
{return "scissors wins"}
else if(choice1==="scissors")
{return "rock wins"}
{return "scissors wins"}


What you do here does not account for all your code.

Calling it with userChoice and computerChoice for all choices checked for and accounted for by your code so what they want you to do is just write,

compare(userChoice, computerChoice)



Oh wow...

I'm dumb.



Haha no you're not it was just a simple mistake. :slight_smile: