Build Rock, Paper, Scissors need some help


#1

Hi guys, I'm stuck at the rock,paper, scissors,

If computerChoice is between 0 and 0.33, make computerChoice equal to "rock".
If computerChoice is between 0.34 and 0.66, make computerChoice equal to "paper".
If computerChoice is between 0.67 and 1, make computerChoice equal to "scissors"

He gives an error about the <= ?

SyntaxError: Unexpected token <=


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


#2

this line:

else if(computerChoice >= 0.34 && <= 0.66)

if you want to use a and operator, you would have to compare at both sides of the and operator. or you could only check if the number is .66 or less? since .33 and smaller are caught by your if statement? if if is true, else if won't run


#3

Thank for the reply, it works now.
I didnt think about the else if like you said..my bad:sweat:


#4