8/9 "choice2 is not defined"


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


but it keeps saying...

ReferenceError: choice2 is not defined

Why has this happened?


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