What's wrong with my code? Where's the problem?


#1

I did everything right (i guess) and used the hint, tried to print out computerChoice but it says TypeError: computerChoice is not a function!! What did i do wrong?

...
https://www.codecademy.com/courses/javascript-beginner-en-Bthev-mskY8/0/3?curriculum_id=506324b3a7dffd00020bf661#

TypeError: computerChoice is not a function

var userChoice = prompt("Do you want to play rock, paper, scissors?")
var computerChoice = Math.random();
computerChoice().

#2

this:

computerChoice()

is a function call. But computerChoice is a variable, not a function. To log a variable to the console, put the variable name inside console.log:

console.log(/*variablename without brackets here*/)

#3

Thanks it worked! I appreciate your help :slight_smile: