4.I have to celebrate you baby


#1

THIS IS REALLY ANNOYING!!!

I get the error: ReferenceError: user is not defined
BUT I DID!!!!!!!:grimacing: this is my code:

var getReview = function(movie) {
var user = prompt("Enter movie name:").toLowerCase();

switch(user){
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!");
}
};

getReview(user);

help!


I'm stuck in this lesson! HELP!
#2

You should put var user = prompt("Enter movie name:").toLowerCase(); outside the function.

and

after return you don't need break


#3

thanks, this helped me a lot


#4

Hi it tried that but it says there a problem with my syntax
var getReview = function(movie) {
switch(user){
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.");
};

getReview(user);
var user = prompt("enter movie name:").toLowerCase();


#5

After return you don't need break so delete it. I think you're mising the default at the end of your switch method. You need 2 brackets } }; at the end which closed the function and close switch method
Also put var user = prompt("enter movie name:").toLowerCase(); to the top