I have to celebrate you baby


#1

error message...movie is not defined
help please!


 var name = prompt("Toy Story 2, Finding Nemo, or The Lion King");
var getReview = function (name) {
switch(movie){
case "Toy Story 2":
    console.log("Great story.Mean prospector.");
    break;
case "Finding Nemo":
    console.log("Cool animation,and funny turtles.");
    break;
case "The Lion King":
    console.log("Great songs.");
    break;
default:
console.log("I don't like movies.");
}
}
getReview(name);


#2

This variable cannot be set in the global object. It belongs to window and is a special property in that context (the window name). Change the variable name to something else like film or even movie.

Check to be sure your strings match exactly to those in the instructions.


#3

now it tells me movie is not defined


#4

Please re-post your corrected code. Thanks.


#5

name = prompt("Toy Story 2, Finding Nemo, or The Lion King");
var getReview = function (movie){
switch(movie){
case "Toy Story 2":
console.log("Great story.Mean prospector.");
break;
case "Finding Nemo":
console.log("Cool animation,and funny turtles.");
break;
case "The Lion King":
console.log("Great songs.");
break;
default:
console.log("I don't like movies.");
}
};
getReview(movie)


#6

Should read,

var movie = prompt(" ...

Also, check your strings.


#8

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