How is this not a switch statement?


Oops, try again. Better use a switch statement

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



you do use a switch statement, but the switch is on the function instead of the function parameter:

 switch(getReview) // switch on the function?

i would use the function parameter instead, since this will hold the value when calling the function


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