Logical Operators


#1

What is wrong, it says that there is an unexpected ILLEGAL token :slight_smile:

var user = prompt("What is your favorite number between 1 and 5").toUpperCase();

switch (user) {
case '1':
console.log("Low Number");
if(true && true) {
console.log("Really")
} else {
console.log("Finally)
break;
case '2':
console.log("You like pears?");
break;
case '3':
console.log("Not too high, not too low, Just Right");
break;
case '4':
console.log("We are really getting up there");
break;
case '5':
console.log("Ah, a perfectionist, 5/5, 100%, A+");
if(false || true) {
console.log("Bored?");
} else {
console.log("Made in JS");
default:
console.log("Learn your counting!");
}


#2

Hi look At all Your else statement you didn't close them

if (condition) { #open the if statement 

} #close the if statement
else { #open the  else statement

}#close the else statement