Any one know why this won't break, and keeps going to default


var getReview = function (movie) {

    case 'TOY STORY 2':
        console.log("Great story. Mean prospector.");
    case 'FINDING NEMO':
        console.log("Cool animation, and funny turtles.");
    case 'THE LION KING':
        console.log("Great songs.");
    console.log("I don't know that");       }

var review = prompt("Which movie are you interested in a review? ").toUpperCase();


Well depending on how you have it there's a couple thing that could be wrong. First of all note that the "case"s are Case Sensitive. meaning if there's any letters that are not capitalized or letters that aren't perfectly matching, it will automatically move to the default case.

Make sure that whatever is in the Variable that matches exactly to what's in the case statement.


Even if i type the wrong question and it go's straight to the default statement, in the console window it gives me a "i don't know that" twice in a row like its looping or something weird.


I took a look at it... it seems really strange.
I feel like it's some kind of really technical thing, or possibly even a bug. It's only a couple of lines, and I couldn't figure it out in 15 minutes.

Not totally sure what it is, but you could just use an if/else if/else instead.


Hey @bluntslide,

You got some prolems there. :smiley:

Actually, one problem.

WHAT ARE THOSE?!(Sorry I had to put that. :smile:)

You see the ".toUpperCase();" part? If you put Toy Story 2, that makes TOY STORY 2. Which doesn't match! That's why it goes to default automatically. IT DOESN'T MATCH! :smiley:


But, his case in the switch statement is "TOY STORY 2", and it prints out BOTH "Great story. Mean prospector." AND "I don't know that."


var getReview = function (movie) {
case"Toy Story 2":
return "Great story. Mean prospector.";

        case"Finding Nemo":
        return  "Cool animation, and funny turtles.";
        case"The Lion King":
        return "Great songs.";
        console.log("I don't know");

var movie=prompt("enter movie name");
try passing movie in your review function other than review and change case to " " double quotes @bluntslide
you have to enter movie name as same as given in instruction if u dont use .toUpperCase( ); or .toLowerCase( ); :smile: