Rock etc, trying not to overthink, & follow instructions exactly, didn't succeed


#1


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

Oops, try again. There was a problem with your syntax.


expected to be correct . . . .

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


#2

Hi Math.random() give you a number between 0 and 1, so you don't need to put anything inside the ().
Then here

var Math.random(0,1);

You should remove it .
You don't need to put it inside the {}.


#3

I followed you suggestion -- still get "oops" message. I have looked at other people's coding and it seems very complex compared to the 3 instructions we were given -- declare, declare, print.
Here is what I now have --- have I over-simplified?

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


#4

Here

{ <== remove it 
var Math.random();
var computerChoice = Math.random();
}; <== this too

Then here

var Math.random();
var computerChoice = Math.random();

you yet save Math.random(); so you don't need of the var Math.random(); so remove it, your code should be like that

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

var computerChoice = Math.random();
console.log(computerChoice);

If it stIll show the error can you Tell me in what lesson are you?


#5

Thank you -- got it right moved on to part 2 Rock Paper Scissors.