Unexpected token {


#1

I don't understand this error message... please help

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

var user = prompt("who are you?").toLowerCase();

swtich(user) {
    case 'peggy':
            console.log ("Peggy");
        break;
    case 'william':
                console.log ("William");
        break;
    case 'hank':
                console.log ("Hank");
        break;
    case 'maggie':
                console.log ("Maggie");
        break;
    default:
                console.log ("Nothing");
};


#2

Check your spelling of switch


#3

doh on my part.... thanks for the fresh look.


#4

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