Code Your Own Adventure 2! Switch Bug?


#1



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


 var user = prompt("What is your name adventurer?").toUpperCase();
switch(user) {
    case 'Steve Rodgers':
        console.log("Hail Hydra");
        break;
    case 'Ethan':
        console.log("Welcome Hero.");
        break;
    case 'John':
        console.log("The destroyer of worlds?! My humble apologies please take whatever you need.");
        break;
    default:
    console.log("Welcome traveler.");
}

Ok the code lets me move on to the next lesson, but no matter what I type in it uses the console.log for the default. Honestly I thought it would be hilarious to have the computer respond with "Hail Hydra" when Cap's name was inputed, but it still comes out with "Welcome traveler." If you could explain why this is and how to fix it I would appreciate it!


#2

@typer55,
You are =UpperCasing= the user variable
then you test for 'Steve Rodgers' which will NOT have a hit ever.....!!!