What is wrong in my code in Introduction to objects-1...Ch-4?Kindly help


#1
var getReview = function(movie) {

    switch (movie) {
        case "Toy Story 2":
            return "Great story.Mean prospector.";
            //break;
        case "Finding Nemo":
            return "Cool animation,and funny turtles.";
            //break;
        case "The Lion King":
            return "Great songs.";
            //break;
        default:
            return "I don't know!";
            //break;
    };

};

console.log(getReview("Toy Story 2"));

#2

Please format your post as I have done (select entire code block; press Ctrl+Shift+C) from next time. Thanks! :smile: Please always use http://jsbeautifier.org/ to properly format your code. Thanks! :smile:

Please post the error you are getting. Thanks! :smile: But I can guess that you have an extra semicolon after switch block.


#3

The error I'm getting is 'Try again.Check the review of Toy Story 2'.Which extra semi colon are you talking about?Kindly reply.


#4

The SCT is very strict about string messages. Make sure you copy the string exactly as shown in the left panel. I think the string you return for Toy Story 2 ("Great story.Mean prospector.") causes the error.

I was talking about the extra semicolon on fifth-last line.


#5

Hey,thanks a lot.I got the correct answer :smile: