Whats the mistake i am doing here ?Oops, try again. Are you sure you're returning the right thing?


#1

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

getReview("The Lion King");

#2

from the instructions:

Write a function named getReview that takes in a movie name and returns its review based on the information above

if you need to return something, use the return keyword


#3

NOW MY CODE IS EXECUTING AND RETURNING THE EXPECTED RESULT. BUT TILL GETTING THIS ERROR "Check the review of Toy Story 2" Why I am getting this error ?
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";
case "The Lion King":
return"Great songs";
break;

    default:
    return "I don't know!";
    break;

}
};
getReview('The Lion King');


#4

the strings returned should be an exact match, a . is missing after


#5

still getting the error

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.";
        case "The Lion King":
        return"Great songs";
        break;
        
        default:
        return "I don't know!";
        break;
}
};
getReview('The Lion King');

#6

a . is also missing after Great songs


#7

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