This block of code's problem "my toy story review isn't right". Looks good to me


#1

var movies = {};

movies.toyStoryTwo = {
name: "Toy Story 2",
review: "Great story. Mean prospector"
};

movies.findingNemo = {
name: "Finding Nemo",
review: "Cool animation, and funny turtles."
};

movies.theLionKing = {
name: "The Lion King",
review: "Great songs."
};

var getReview = function (movie) {
switch(movie){
case 'TOY STORY 2':
return movies.toyStoryTwo.review;
case 'FINDING NEMO':
return movies.findingNemo.review;
case 'THE LION KING':
return movies.theLionKing.review;
default:
return "I don't know that";
}
};

var views = prompt("What movie are you interested in a review").toUpperCase();
var rev = getReview(views);

console.log(rev);


#2

Maybe this is right

var movies = {};

movies.toyStoryTwo = {
name: "Toy Story 2",
review: "Great story. Mean prospector."
};

movies.findingNemo = {
name: "Finding Nemo",
review: "Cool animation, and funny turtles."
};

movies.theLionKing = {
name: "The Lion King",
review: "Great songs."
};

var getReview = function (movie) {
switch(movie){
case 'TOY STORY 2':
return movies.toyStoryTwo.review;
case 'FINDING NEMO':
return movies.findingNemo.review;
case 'THE LION KING':
return movies.theLionKing.review;
default:
return "I don't know that";
}
};

var views = prompt("What movie are you interested in a review").toUpperCase();
var rev = getReview(views);

console.log(rev);

#3

I know it's right, but the #Codecademy editor say's my "Toy Story Review" is incorrect. I know the spelling has to be the same as what codecademy has, or they will say it's wrong, but the review looks correct to me.


#4

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.");
        
        default:
            return("Don't have review about that one!");
    }
};

Look this correct code and your code. Try to understand what you are writting because if you don't you won't progress or learn anything.
Ask anything you want !