Can someone please tell me what's wrong with my code?


#1



Can someone please tell me what is wrong with my code ?

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


Oops, try again. Did you set var computerChoice = Math.random() ? The capital 'M' in 'Math' is important!


var userChoice = prompt ("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
console.log (computerChoice);
if (computerChoice < 0.34) {
    computerChoice = "rock";
} else if (computerChoice <= 0.67) {
    computerChoice = "paper";
} else {
    computerChoice = "scissors";
} console.log("Computer: " + computerChoice);


#2

@mjeeezyy,

Try a refresh Browser

++++ reset of session *****************
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser

and

Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

Addendum
General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).


#3

I tried that and it still didn't work


#4

Did you try reset lesson and paste in again? Refreshing your page?

If so try using a different browser


#5

Okay I'll try using a different browser because I've clicked on reset a lot of times and refreshed my browser like a million times and it still doesn't work


#6

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

if (computerChoice < 0.33)
{
computerChoice = "rock";
}
else if (0.34 < computerChoice < 0.66)
{
computerChoice = "paper";
}
else
{
computerChoice = "scissors";
}
console.log("Computer choice is" + " " + computerChoice)