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


#1

Hey guys,

i'm getting the same error, my code looks just fine.

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

My code:

var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
console.log = (computerChoice)
if (0 < computerChoice < 0.33) {
computerChoice = "rock";
}
else if (0.34 < computerChoice < 0.66) {
computerChoice = "paper";
}
else {
computerChoice = "scissors!";
}


#2

I think that the problem is in your conditions here:

and here:

Use the and operator like this:

if ((0 < computerChoice) && (computerChoice < 0.33))

And you don't need to print the computerChoice here:


#3

i changed my code, but it's giving me the same error.


#4

When I try it the code works. There is no error message. Try to refresh the page or restart the browser.