Need help,thanks


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

The codes returns with"ReferenceError: Invalid left-hand side in assignment".


The two primary errors are,

  1. "movie" instead of movie; and,
  2. = instead of ===

Those two fixes should correct any running errors.

Is this exercise expecting a switch statement?


You will have to use a so-called comparison operator, == or ===
you will compare to the variable movie
and not as you do, using comparing to a string "movie"
So change your

("movie"="Toy Story 2")


(movie==="Toy Story 2")


Thank you

I have got a correct answer,but the system does not accept it.


Please see my screenshot


As suspected, the lesson checker is expecting a switch statement.

    switch (movie) {
    case "Toy Story 2": 
        return "Great story. Mean prospector.";
    default: "I don't know!";


Ha ha,that's the point,thank you.