I have to celebrate you baby


This is my code for the challenge "I have to celebrate you baby". It works and displays the review, but won't let me pass the challenge. It says that I need to use a switch statement and I'm pretty use this is a switch statement. I must have something out of place or something?

var getReview = function (name) {

switch(name) {    
case 'Toy Story 2': 
    console.log("Great story. Mean prospector.");

case 'Finding Nemo': 
    return("Cool animation, and funny turtles.");

case 'The Lion King': 
    console.log("Great songs.");
console.log("I dont know!");

getReview("The Lion King");


It works fine for me. What's your error message?


It says that I need to use a switch statement. Which I have used a switch statement.


Could you post a screenshot of what you're seeing, please?



I see where on Finding Nemo, I used return instead of console.log. I switched it to console.log and it still won't let me pass and says the same thing "Better use a switch statement".


Try this:

var getReview = function (movie) 
    case "Toy Story 2":
        return "Great story. Mean prospector."

    case "Finding Nemo":
        return "Cool animation, and funny turtles."
    case "The Lion King":
        return  "Great songs."

        return "I don't know!"

getReview ('Finding Nemo');

Key differences are that the return function was used for all three, the brackets were removed from around the text set to be returned, and the function name is set to 'movie' instead of 'name'.


Thank you for the info, I understand now. It passed!