Passed but Code Does not Work Properly (Logical Operators 5/6)


#1

Hi! I managed to pass this exercise but the code doesn't give me the result I want.
Everything's working fine except that I can't get the message "It'll be cold. Bring more clothes!" if I key in January or some other month in the 1st case. Instead, "That's a nice time to visit!" appears regardless of the month I enter.

Can anyone help? Thanks!

var user = prompt("Hi there! Where are you going for the holidays? (Taiwan, Austrialia or Nowhere?)").toUpperCase();

switch(user) {
    case 'TAIWAN':
        var month = prompt("When are you going?");
        if (month === "March" || "June") {
            console.log("That's a nice time to visit!");
        } else {
            console.log("It'll be cold. Bring more clothes!");
        }
        break;
        
    case 'AUSTRIALIA':
        console.log("Cool!");
        break;
        
    case 'NOWHERE':
        var busy = prompt("Are you busy at work?");
        var travelled = prompt("Did you just come back from a holiday? (Yes or No)");
        if (busy === "Yes" && travelled === "Yes") {
            console.log("Perhaps you can travel next year");
        } else {
            console.log("You should really make some plans to travel!");
        }
        break;
        
    default:
       console.log("You should head somewhere!");
        
}

#2

@weichunseah,
You will have to change the IF condition

(month === "March" || "June")

into

(month === "March" || month === "June")

#3

I see, thank you so much! It works properly now :slight_smile: