Movie collection return error


#1

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

Help is needed. My code is returning "Great story. Mean prospector" but still an error message:
Oops, try again. Check the review of Toy Story 2

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!";
        
        return movie;
        }
};
getReview("Toy Story 2");

#2

remove return movie; because you are already returning something for each case. No need to return twice.
Also, indent return "I don't know!"; under default.


#3

Great story. Mean prospector //need a . here

Great story. Mean prospector .

p.s. But its too true that why are you using return twice ? it doesn't work.


#4

I removed return movie; byt still i'm stuck with the error. Oops, try again. Check the review of Toy Story 2 . Although my code seems to return the correct "Great story. Mean prospector"


#5

My code is like this now:

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

};
getReview("Toy Story 2");


#6

you havn't done yet what i have told to you


#7

Soory but it seems i'm getting blind, i'm not seeing this..


#8


Great story. Mean prospector // just add a . after it

like Great story. Mean prospector . (can you see here a .)

:slight_smile:


#9

Feeling a bit stupid. THX


#10

but you are not actually :slight_smile:


#11

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