Switch :No syntax error, but problems with returns?


#1


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


No error messages, it's quite happy with the actual code, but all of the names are returning the console log for default. Not sure what's happened.


var user = prompt("what's your name?").toUpperCase();
switch (user){
    case 'Jenny':
    console.log("Do you know Forest Gump?");
    break;
    
    case 'Clara':
    console.log("Have you ever traveled through time");
    break;
    
    case 'Lisanne':
    console.log("That's an awesome name");
    break;
    
    default:
        console.log("I've never heard that name before. It's pretty.");
    
}


#2

var user = prompt("what's your name?").toUpperCase();

you are making input to uppercase but for checking you mixed case

case 'Jenny':


#3

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