Build "Rock, Paper, Scissors" 3. Computer Choice: Part 1


#1

This seems too straight forward I'm must be missing something.

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

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

whats wrong with this?? it keeps telling me Oops, try again. Did you remember to log computerChoice to the console? I'm not following. How do I log it?


#2

Have you tried using console.log?


#3

Just add and use console.log() to print out your computerChoice


#4

I'm looking at other examples and I don't see where the console.log goes.


#5

In this exercise, they want you to log computerChoice to the console so you can see what Math.random() does. Try it on your next line of code.


#6

It's simple. What it asks you is to log the randomly generated computerChoice variable to the console. To do this, you can insert the following piece of code after the var computerChoice = Math.random() line:

console.log(computerChoice);

#7

Thanks, the dots were not connecting for me with this one. lol


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.