I have to celebrate you baby Issue


#1


https://www.codecademy.com/courses/spencer-sandbox/0/4?curriculum_id=506324b3a7dffd00020bf661#


I keep on getting: "Oops, try again. There was a problem with your syntax." Please tell me what's wrong with it.


var getReview = 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;
};


#2

getReview should be a function taking movie as the parameter...then we pass different arguments at the time of function calling, which the switch statement provides....

hope that helps...


#3

Is this better?

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;
};

#4

Perfect except one mistake......since getReview is a function it should contain a function body..and that body should be written under

{}

The entire switch statement is your function body in this case, so make sure to put it under

var getReview = function (movie) {


}

#5

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