I have to celebrate you baby


#1

I'm really confused. is this code correct?

var name = prompt("Toy Story 2, Finding Nemo, or Lion King");

var getReview = function (movie) {

switch(movie){
case 'Toy Story 2':
return("Great story. Mean prospector.");
break;
case 'Finding Nemo':
return("Cool animation, and funny turtles.");
break;
case 'The Lion King':
return("Great songs.");
break;
default:
return("I don't know!.");
}
};

When I press Save & Submit Code, Codecademy says: Way to go! Start Next Lesson

But the console is not printing anything out.


#2

to execute a function, call the function


#3

you need to call getReview() and put it in console.log():

var name = prompt("Toy Story 2, Finding Nemo, or Lion King");
console.log(getReview(name));

#4

Thanks Guys.
Is it a bug that Codecademy accepted it without calling the getReview, though?


#5

the exercise validates that your function works correctly

if a function call is required by the instructions, then yes it is a bug, otherwise no


#6

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