IF statement is true, but returning ELSE instead?


#1



Choose your own adventure 2

In the case for LEFT it is asking whether health and money are equal to zero, which it is, however it returns the else statement instead saying "You continue on your way" rather than the first one saying "Robbers come out and kill you"
I don't quite understand why it is going to the else statement, when the first IF condition is true. Any ideas?


Replace this line with your code. 
var user = prompt ("You begin your adventure. Do you wish to stay or take a left, or a right on the road ahead?").toLowerCase();
var health = 0;
var money = 0;
var armor = 12;


switch(user){
    case "left":
        console.log("You take the path to the left.");
            if(health && money === 0){
                console.log("Robbers come out of the bushes and kill you!");
            }else{
                console.log("You continue on your way");} 
                break;


#2

This post was flagged by the community and is temporarily hidden.


#3

This post was flagged by the community and is temporarily hidden.


#4

I attempted to change it to .lowercase, but it didn't seem to recognize it.
That aside I still don't understand why it skips over to the ELSE statement instead.


#5

This post was flagged by the community and is temporarily hidden.


#6

This post was flagged by the community and is temporarily hidden.


#7

This post was flagged by the community and is temporarily hidden.