5 logical operaters


#1

var user = prompt("A fire ecrupts before you can exit the lunar module, will you TURN OUT the fire, OPEN the hatch before decompressurizing, or RADIO the emergency crew?").toUpperCase();
switch(user){
case 'TURN OUT':
var costco = prompt("Did you get a fresh extinguisher from costco (YES or NO)?").toUpperCase();
var hose = prompt("Can you reach the water hose?").toUpperCase();
if(costco === 'YES' || hose === 'YES') {
console.log("You either bought a fresh extinguisher or used the water hose from the greenhouse!");
} else {
console.log("Your old extinguisher is out and you couldnt reach the hose, you're toast!"); }
break;
case 'OPEN':
var dicompressure = prompt("Did you dicompressure the room (YES or NO)?").toUpperCase();
var suit = prompt("Is your space suit on?").toUpperCase();
if(dicompressure === 'YES' && 'YES') {
console.log("The room is safe to exit, you hop to your buddies barracks for a sandwich.");
} else {
console.log("The room is full of atmospheric air! Your bones are shattered as you are sucked out the half opened hatch even with a suit on!"); }
break;
case 'RADIO':
var sober = prompt("Is angel sober (YES or NO)?").toUpperCase();
var batman = prompt ("Is batman helping angel?").toUpperCase();
if(sober === 'YES' && batman 'YES') {
console.log("Angel and batman show up and turn out the fire!");
} else {
console.log("Even if angel is sober, he can't read the directions to get to your lunar module and he doesn't make it in time!"); }
break;
default:
console.log("You must make the right choices."); }

I cant find my mistake!


#2
if(dicompressure === 'YES' && 'YES') {
if(sober === 'YES' && batman 'YES') {

This 2 lines don't make sense to me.
In the first one, the second condition is nonsense. If dicompressure equals in type and value to 'YES' and if 'yes'.... yes what?
in the second line you missed a comparisson operator.

batman ... 'YES'

#3

ops, I forgot the SUIT === 'YES' in the first one. thankyou!