4. Celebrate you baby - Syntax Error


#1

I keep getting a syntax error saying that ")" is missing after argument list. I hvae tried resetting the browser to no avail.

Anyone know whats wrong with the code?

Thanks in advance

var toyS = {
title: "Toy Story 2",
review: "Great story. Mean prospector."
};

var findingN = {
title: "Finding Nemo",
review: "Cool animation, and funny turtles."
};

var lionK = {
title: "The Lion King",
review: "Great Songs."
};

var getReview = function(name){
switch(name) {
case "Toy Story 2":
return toyS.review;
case "Finding Nemo":
return findingN.review;
case "The Lion King":
return lionK.review;
default:
return "I don't know!"
}
};

console.log(getReview(The Lion King));


#2

Hi there! First of all, add a break; line for each of the cases, except for the default as it is at the end. Secondly, add a semicolon after "I don't know!". Lastly, use double quotation marks or single ones, as you wish, for getReview("The Lion King")

I hope this will fix the error :smile: Let me know if it doesn't


#3

@arichards1227,
You want to call the getReview =function=
with an string Value "The Lion King"

 console.log(getReview("The Lion King"));

PS.
As you are using the return statement
you do not need a break-statement in your switch !!


#4

That did it! Thanks for the help! and the confirmation about those return statements.