5. Logical Operator's


#1

i'm just getting syntax error, whats wrong?

var user = prompt("Are you gonna play a game tonight. Yes, no, maybe?").toUpperCase()

switch(user) {
case 'YES':
Var game = prompt("do you have a game?").toUpperCase();
If(user === 'YES' && game === 'YES') {
console.log("Then play on bother");
} else {
console.log("To bad, no gaming");
}
break;

case 'NO':
console.log("Oh i'm sure you will");
break;

case 'MAYBE':
Var gaming = prompt("do you have a game?").toUpperCase();
If(user === 'MAYBE' || gaming === 'YES') {
console.log("You sound like you want to play");
} else {
console.log("Maybe not tonight eh?");
}
break;

default:
console.log("Thats not an answer");

};


#2

I think that you forgot to put the semicolon after first line:
var user = prompt("Are you gonna play a game tonight. Yes, no, maybe?").toUpperCase();


#3

Write all the

var

and

  if

in smaller case. 2 of the variables are written as "Var" instead of "var" and there are 2 "If" written as "If" instead of "if". I hope it helps :smile: