Unexpected identifier


#1

What's the problem?

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 and <= 0.66) {
computerChoice = "paper";
} else {
computerChoice = "scissors";
};
console.log(computerChoice);


#2

Are you getting any error? If not, then I think that first condition should be computerChoice >= 0 && computerChoice <=0.33 (include 0.33) and second condition should be computerChoice >= 0.34 && computerChoice <=0.66.


#3

The javaScript version of and is && and the computer is dumb and doesn't know context so you need to tell it again what you want it to be compared with X <= 0.66.