My code isn't working


#1

I have to celebrate you baby

Why isn't my code working? Please, check. Thank you.

Error: Please, use the switch statement.

var myMovie = prompt("Please, type in a Movie name.");

var getReview = function(name){

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

};

var myMovieReview = getReview(myMovie);
console.log(myMovieReview);


#2

1.

return "Greaty story. Mean prospector.";

should be

return "Great story. Mean prospector.";

2.

return "Cool animation, and funny trutles.";

should be

return "Cool animation, and funny turtles.";

3.

switch (name)

should be

switch (movie)

In addition to corrections, my suggestion is that when you return a value inside a switch, you don't need a

break

so you can remove that redundancy.


#3

Thank you very much for your help. I got my code working.

Thank again.