Stuck on Objects 1 #4 "I have to celebrate you baby"


#1


I'm stuck on Objects 1 #4 "I have to celebrate you baby".


The code does exactly what it's supposed to, as far as I can tell, but I keep getting an error message saying "Oops, try again.
Are you sure you're returning the right thing?" I've checked the spelling and grammar of the 'reviews' the code is returning, and I've also tried replacing the console.log with return, but for some reason it still isn't working. Can anyone help?


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

I can't work out why it isn't working. Please help!

Thanks!


#2

The key word here is returning, in your function you are logging the results to console but you should be returning them with the return keyword instead.
Also you have to move the first line in your function outside of it.
When you you call your getReview function you then pass what ever the user enters as argument


#3

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