I have to celebrate you baby


#1



https://www.codecademy.com/courses/spencer-sandbox/0/4?curriculum_id=506324b3a7dffd00020bf661#


My code is not working and I receive the error message "Oops, try again.
Check the review of Toy Story 2". Please help. I've checked the forum and my code looks like the corrected answers but for some reason mine isn't working.


Replace this line with your code. 
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!";
}
};


#2

I added double quotes to the lion king return "great songs" and it still doesn't work...


#3

HI the review of Toy story 2 should be

"Great story. Mean prospector."

with the dot after prospector

And

the same for the review of the the lion king put a dot after great


#4

Your default statement should be "I just don't know!" instead "I don't know!"


#5

Thanks :smile: Works now. I didn't realize adding the periods to the strings would make a difference.


#6

Yeah you have to be really careful about even the strings with this, You are refused you creativity with the writing it seems, has to be word for word, uppercase letter for uppercase letter.


#7

hi I’ve an answer

var retour = function (film) {
switch(film){
case "Toy Story 2":
return "Bon film, j'adore les cowboys !";
break;

case "Nemo":
    return "Bonne animation, les tortues sont cool.";
    break;

case "Le Roi Lion":
    return 'Super musiques.'
    break;

default:
return "Je ne sais pas!";
}
};


#8

It is because of the Language Processor. It breaks into lexemes which has to be exactly equal. So that is why even the strings has to be exactly same.


#9

I have found that must of the errors that appears on Codeacamy is due to a not exactly write of what they say in task.

Example:

In the exercise they say: write the return of "Finding Nemo." as "Great songs." in your answer you missed a end point. You wrote "Great songs" instead.

This is was my answer to this task: ( Hope it help! :slight_smile: )

var movie = prompt("Get movie review?");

var getReview = function (movie) {
    switch (movie) {
        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 that movie.";
    }
};

console.log(getReview(movie));

#10

var getReview = function (movie) {
switch(movie){
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!";
}

};


#11

I'm also having problems with this lesson. My code works, but I keep getting the error message "Oops, try again. Are you sure you're returning the right thing?" Well, actually, yes, I am sure, but it keeps telling met that I need to try again and I can't complete the lesson. Here is my code:

var getReview = function (movie) {
    movie = prompt("What is your 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 know!");
    }
};'

Also, someone previously posted that the default message should be "I just don't know!" but the lesson very clearly states "I don't know!" I tried both, but with the same result.


#12

Tou don't need prompt() method because fucntion takes one parameter movie. So, remove this line and call your function like this:

getReview("Toy Story 2");

#13

That was it! Thanks.