I have to celebrate you baby


#1


I keep getting. "Better use a switch statement." Even though i think im already using one!""


Replace this line with your code. 
var getReview = function () {
    var Movie = prompt("What's your favorite 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!");
            break;
    };
}
getReview();


#2

Try removing the prompt and function call at the end -> getReview()
And put movie inside the function as its value.


#3

after default we don't use "break", this is your mistake :slight_smile:


#4

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!");
}

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

my code is working but it showing.."Oops, try again. Check the review of Toy Story 2"


#5

This stays where it is. This is used to call a function with a value of what user writes when he is prompted.

This is not needed. Because on your function call with value, then your value goes into switch statement which will return corresponding string according to to user input on prompt


#6

remove the function and everything from the bottom,then add a prompt command to choose any from the your switch statement.
your prompt command must be your first statement :slight_smile:


#7

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