Lesson 4 Part 2. SyntaxError: expected expression, got '<'


#1


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


SyntaxError: expected expression, got '<'

What am I doing wrong?


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

if (computerChoice < 0.33) {
    computerChoice = "rock";
} else if (computerChoice > 0.34 && < 0.66) {
    computerChoice = "paper";
} else {
    computerChoice = "scissors";
};


#2

Try to change condition for if-else if-else statement:

if(computerChoice <= 0.33){
    computerChoice = "rock";
} 
else if(computerChoice >= 0.34 && computerChoice <= 0.66){
    computerChoice = "paper";
}
else{
    computerChoice = "scissors";
}

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.