Code your own adventure (4. Switch)


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:

SyntaxError: Invalid or unexpected token

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

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


You left your string unclosed right there.

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


Thank you so much and for that tip!

I had a feeling it was a dumb mistake.


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