[Solved] Introduction to Objects I movies and reviews


Write a function named getReview that takes in a movie name and returns its review based on the information above. If given a movie name not found just return "I don't know!". Use a structure learned in an earlier lesson (NOT if/else statements) to write this function.

My code:

var getReview = function (movie) {
var user = prompt("Enter movie name")
switch (user) {
case "Toy Story 2":
console.log("Great story. Mean prospector.")
case "Finding Nemo":
console.log("Cool animation, and funny turtles.")
case "The Lion King" :
console.log("Great songs.")
console.log("I don't know!");


And it says to me: "Oops, try again. Better use a switch statement"
What am I doing wrong?



If still stuck at the very end of your script there is
If I am correct you are told to get the review for The Lion King... wich means getReview() should look like this..
getReview("The Lion King")
Hope it helped... if not well then let ppl know in by answering.


No, it doesn't work, same problem. It just says Better use a switch statement.


I copied this code and it worked

var name = prompt("Which movie would you like to review");
var getReview = function (movie) {
switch(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";

So I guess its a bug on codecademy, or not telling exactly how the task needs to be done