Cant find my syntax error "unexpected identifier"


#1

Getting a syntax error, I cant seem to find it.

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


Error message says SyntaxError: Unexpected identifier


var user = prompt("Welcome to the school of Magic. Do you choose Earth, \ Wind, Water, or Fire?").toUpperCase();

switch user {
    case 'EARTH':
        prompt("Great choice! Nothing as sure as the ground beneath your \ own two feet!");
    break;
    
    case 'WIND':
        prompt("Great choice! It takes a skilled mage to feel and \ understand the delcacies of the wind.");
    break;
    
    case 'WATER':
        prompt("Great choice! Water is a very versitile element, with it \ comes many challenges.");
    break;
    
    case 'FIRE':
        prompt("Great choice! Fire is as hard to control as wind, but much \ more deadly to the mage learning it's power. Be Careful!");
    break;
    
    default:
        Prompt("Not off to a great start are we? Inability to follow \  instructions WILL get you killed in mage training. Try again.");
};


#2

Ahhhh

switch user {

needs to look like this:
switch(user) {

I forgot the paranthesis :slight_smile: woops!


#3

I was just coming to ya! xD Good find! Saved me a few typing words :stuck_out_tongue:


#4

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