Switch


#1


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


I believe this is all correct but it wont pass and says syntax error: unexpected token (
I dont see anything so maybe it just needs a fresh pair of eyes?


var user = prompt("what's for breakfast?").toUpperCase();

switch(user) {
    case 'pancakes':
        console.log("Best served with maple syrup!");
        break;
    case 'eggs and toast':
        console.log("Sunny side up");
        break;
    case 'waffles':
        console.log("Topped with whipped cream and strawberries");
        break;
    default:
        console.log.("I don't even eat breakfast");
    }


#2

Remove .toUpperCase() or change all your case strings into CAPITAL letters. :slight_smile:


#3

I tried both, and neither worked :frowning:


#4

Just check them all, there are 7


#5

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