3. Computer Choice: Part 1


#1

I keep getting a "Did you remember to log computerChoice to the console?" message

here's my code

var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();

is there anything wrong with it? Im not sure if im supposed to put any console.log code here


#2

Well, you need to log computerChoice to the console, like the error says:

console.log(computerChoice);

#3

I tried putting it in but I still keep getting the same error message.

code now looks like this

var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
console.log("computerChoice");

I also tried refreshing, but it's still the same


#4

You want to use console.log on your variable computerChoice, you are currently log a string "computerChoice" to the console, to log a variable do:

console.log(variable);

to log a string:

console.log("string");

#5

I tried removing the " " from the console.log and it worked.

I got a number for an answer.
Thank you!