This forum is now read-only. Please use our new forums! Go to forums
banner
Close banner
SyntaxError: Unexpected token {
This is my code
var userChoice = prompt("Do you chose rock, paper or scissors?");
var computerChoice = Math.random();
console.log(computerChoice);
if(computerChoice > 0 <0.33){
console.log("rock");
}
else if(computerChoice > 0.34 <0.66){
console.log("paper");
}
else(computerChoice > 0.67 <1){
console.log("scissors");
}
what’s wrong?
Answer 560e4166e39efe70ed000207
1 vote
There are no conditions allowed after else: https://www.codecademy.com/forum_questions/52373a75548c3515940000dc#response-529fa53c8c1ccc73b5000359 https://www.codecademy.com/forum_questions/52373a75548c3515940000dc#response-529fa36052f863bb58000338
and this kind of condition does not work: computerChoice > 0.34 <0.66
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
1 comments
Oh thanks