I have to celebrate you baby


#1


var movies=new Object()
movies.toyStory={
    name: "Toy Story 2",
    review: "Great story. Mean prospector."
}

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

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

var getReview = function (movie) {
switch(movie){
    case"Toy Story2":
    return movies.toyStory.review;
    break;
    case "Finding Nemo":
    return movies.nemo.review;
    break;
    case "The Lion King":
    return movies.king.review;
    break;
    default:
    return "I don't know!";
    }
    
};

getReview("The Lion");

"and this is my error message:Oops, try again. Check the review of Toy Story 2. What.s the problem? Thnx""


#2

the string returned should be an exact match, copy paste it from the instructions

also, Toy Story 2 is not the same as Toy Story2


#3

I fixed it but it doesn"t work. My code is working but I get an error message.


#4

can i see an updated version of your code?


#5

I send it to you later when I get home.

  1. febr. 16. 17:51 ezt írta ("Stetim94" codecademy@discoursemail.com):

#6

My code:

var movies=new Object()
movies.toyStory={
    name: "Toy Story 2",
    review: "Great story. Mean prospector."
}

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

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

var getReview = function (movie) {
switch(movie){
    case"Toy Story 2":
    return movies.toyStory.review;
    break;
    case "Finding Nemo":
    return movies.nemo.review;
    break;
    case "The Lion King":
    return movies.king.review;
    break;
    default:
    return "I don't know!";
    }

};

getReview("Finding Nemo");

#7

if i run your code, everything is fine


#8

Yes, it's okay at me too


#9

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