Problem with Movie reviews


#1


https://www.codecademy.com/courses/spencer-sandbox/0/4?curriculum_id=506324b3a7dffd00020bf661


When I hit the save and submit code button, a statement pops up that says "Oops, try again. Check the review of Toy Story 2". I don't know what to do, because it looks right to me.


var toyStory2 = {
    name: "Toy Story 2",
    review: "Great story. Mean prospector"
}
var findingNemo = {
    name: "Finding Nemo",
    review: "Cool animation, and funny turtles."
}
var theLionKing = {
    name: "The Lion King",
    review: "Great songs"
}
var movieList = [toyStory2,findingNemo,theLionKing];
var getReview = function(movie) {
    switch(movie) {
        case toyStory2.name:
            return toyStory2.review;
        case findingNemo.name:
            return findingNemo.review;
        case theLionKing.name:
            return theLionKing.review;
        default:
            return "I don't know!";
    }
}
console.log(getReview("Toy Story 2"));


#2

just need a . at the end

review: "Great story. Mean prospector." // see the .

same for the theLionKing


#3

The website still won't accept it


#4

can you please post your updated code?


#5

var toyStory2 = {
name: "Toy Story 2",
review: "Great story. Mean prospector."
}
var findingNemo = {
name: "Finding Nemo",
review: "Cool animation, and funny turtles."
}
var theLionKing = {
name: "The Lion King.",
review: "Great songs."
}
var movieList = [toyStory2,findingNemo,theLionKing];
var getReview = function(movie) {
switch(movie) {
case toyStory2.name:
return toyStory2.review;
case findingNemo.name:
return findingNemo.review;
case theLionKing.name:
return theLionKing.review;
default:
return "I don't know!";
}
}
console.log(getReview("Toy Story 2"));


#6

name: "The Lion King.", //remove the . at the end.

don't do extra.In your own environment your code is absolutely fine :slight_smile: .but here you have to do what instruction told you to do even a single space.sometimes you'll get in trouble for this.


#7

can this code work if place at my site, just for a small reference. thanks guys. sbobet737


#8

Thanks, it works now.


#9

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