UNexpected token case syntax


#1

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

syntax error unexpected token


var user = prompt("What is your name?").toUpperCase();
switch(user)
{
    case 'HAN': 
        if(1 + 1 == 2) 
        {
            console.log("You ugly")
        }
        else 
        {
            console.log("You broke the glass")
        break;
    case 'Edd':
        if(1 - 1 == 0 || 1 == 1)
        {
            console.log("You ugly")
        }
        break;
    case 'BRANDON':
        console.log("You ugly")
        break;
    default:
        console.log("You ugly")
        break;
}


#2

Make another line by line review of your code. Check the semicolons, braces, colons etc. Make sure everything is correct. I'm sure you'll find it.


#3

i stiil dont see where i messed up.


#4
```
else 
    {   //you forgot to close this

        console.log("You broke the glass")

`


#5

oh i get it so each and every console.log statement has to be closed


#6

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