Code your own adventure (4. Switch)


#1

HELP! I keep getting a syntax error and I think I have stared at it long enough that I'm not catching the mistake. It has to be a dumb small mistake at this point. Thanks in advance for the help guys! :sunglasses:


https://www.codecademy.com/courses/javascript-beginner-en-ZA2rb/0/4?curriculum_id=506324b3a7dffd00020bf661#


SyntaxError: Invalid or unexpected token


var user = prompt("Wanna Play?").toUpperCase();

switch(user) {
    case 'No':
        console.log ("Bummer, you suck!!");
        break;
    case 'Yes': 
        console.log ("HUZZAH!!");
        break;
    case 'Yea':
        console.log ("SWEET!!);
        break;
    default: 
        console.log("Oh well, maybe next time.");
}


#2

You left your string unclosed right there.

Just remember if everything turns red then you will know that you left a string unclosed somewhere.


#3

Thank you so much and for that tip!

I had a feeling it was a dumb mistake.


#4

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