The switch isn't working!?


:angry: :sob: This switch isn't working as its supposed to :angry: :sob:

There aren't any error messages, but the switch is doing the wrong thing. It running the default case for some reason despite the input

var user = prompt('Your name is...').toUpperCase();
switch (user) {
    case 'Buster':
        console.log('Phelp\'s son?');
    case "Michael":
        console.log("Are you in the Jackson five");
    case "Monty":
        console.log("Do you code in Python?");
    case "David":
        console.log("David Livingstone I presume?");
        console.log("Good Name");


The value you switch on has been converted to all upper case, but none of the cases are all upper case


You asked for uppercase, so change you case to uppercase.

case 'BUSTER':
        console.log('Phelp\'s son?');


Thank you very much for your clear explanations. :slight_smile:


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