Computer part 1


#1

I followed everything right but yet its telling me to do something I have already done, task below that I have to do......................

Computer Choice: Part 1

Awesome! We now need the computer to make a choice. The game is only going to be fun if the computer chooses randomly. Luckily JavaScript has something that can help with this.

If we declare a variable and make it equal to Math.random(), that variable will equal a number between 0 and 1.

Instructions

  1. Under your previous code, declare a variable called computerChoice and make it equal to Math.random().
  2. Print out computerChoice so you can see how Math.random() works. This step isn't needed for the game - just useful for learning!

?

Hint

Your Math.random() code should look something like this:
var computerChoice = Math.random();

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

on screen...............

its telling me did I remember to log computerChoice on to the console?

What does that mean?


#2

What do you use in javascript to make things LOG to the CONSOLE? If you want to PRINT something to the display, you use a console.log statement.


#3

this is what I did an its still wrong

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

{console.log ("computerChoice")}


#4

I'm curious as to why you put your console.log statement inside of curly braces and why your computerChoice is in quotation marks.


#5

And please show us your complete code.