Another one stuck on #5... Can someone help me?


#1

Okay, I've been working on this for hours, and cannot see the mistakes I'm making. In fact, I'm probably making more errors now trying to figure it out. Help would be really appreciated!

var user = prompt("Where do you want to go?").toUpperCase();

switch(user) {
    case 'MEXICO':
        var Spanish = prompt("Do you speak Spanish? (YES or No)").toUpperCase();
        var Pesos = prompt("Do you have pesos? (YES or NO)").toUpperCase();
        
        if(Spanish === 'YES' && Pesos === 'YES') {
            console.log("Diviertete en México!");
        }
        else {console.log("Don't go!");
        }
        break;
        case 'HAWAII':
            var FlipFlops = prompt("Do you have flip flops? (YES OR NO)").toUpperCase();
            var BathingSuit = prompt("Do you have a bathing suit? (YES OR NO)").toUpperCase();
            if (FlipFlops === 'YES' || BathingSuit=== YES')
            {
            console.log("Ohana means family. Have fun!");} 
            else {
                console.log("Stay home!");
            }
            break;
            case 'COLOMBIA':
                console.log("Que Chimba.");
                break;
                default:
                console.log("Guess you want to stay home");
};

#2

@chiprockstar42957:
You had an unclosed string, you forgot that single quote

How it was:

if (FlipFlops === 'YES' || BathingSuit=== YES')

How it should be:

if (FlipFlops === 'YES' || BathingSuit=== 'YES')

#3

Ah, how easy those things can be missed! Thanks so much, Gabe!


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.