4.I have to celebrate you baby


#1

Oops, try again. Better use a switch statement.

var getReview = function(expression) {

var x = "I don't know";

switch(expression) {
    case "Toy Story 2":
        x = "Great story. Mean prospector.";
        break;
    case "Finding Nemo":
        x = "Cool animation, and funny turtles.";
        break;
    case "The Lion King":
        x = "Great songs.";
        break;
};

return x;

};

getReview("Toy Story 2");


#2

var toyStoryTwo = {
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 getReview = function (movie) {
switch (movie) {
case "Toy Story 2":
return toyStoryTwo.review;
case "Finding Nemo":
return "Cool animation, and funny turtles.";
case "The Lion King":
return theLionKing.review;
default:
return "I don't know!";
}
};

var user = prompt("Coose a movie!");

getReview(user);


#3

hey rockstar,
you should replace the x within your switch statement with
return "string";
instead of putting the return at the end;
It will accept the code with that