8/9 "choice2 is not defined"


#1

So I've called my variables like this...

userChoice(choice1);
computerChoice(choice2);

but it keeps saying...

ReferenceError: choice2 is not defined

Why has this happened?


#2

You don't need to call your variables. What you'll want to do is reference your variables when you call your function

compare(userChoice, computerChoice);

this will automatically assign userChoice to choice1 and computerChoice to choice2

just as:

compare(computerChoice, userChoice);

would assign computerChoice to choice1 and userChoice to choice2

hope this helps