4/6 Choose Your Own Adventure 2


It's saying my code is correct and giving me the "Way to go!", but no matter what pet I choose I always get the default answer. So something isn't right. Here is my code:

var user = prompt("What is your favorite pet?").toUpperCase();

switch(user) {
    case 'Dog':
        console.log("Dog's are my favorite too!");
    case 'Cat':
        console.log("Cat's are very good hunters and will keep the pests away.");
    case 'Snake':
        console.log("Hm... I'm not a fan of reptiles as pets. I think they need to live in their natural habitat.");
        console.log("As long as you take care of your pet, love it, and keep it as comfortable and happy as possible I think that's great.");


Right there, you are turning all responses to uppercase, so typing dog or Dog or doG, etc. will turn into DOG. You aren't checking for a case 'DOG' so it falls through.


Rookie mistake :stuck_out_tongue_winking_eye: Thank you!