What am i doing wrong? 4. I have to celebrate you baby


#1

on: 4. I have to celebrate you baby, I don't know what i'm doing wrong here:
var getReview = function (movie) {
switch(movie) {

    case'Toy Story 2':
        return 'Toys cant talk What';

    case'Godzilla':
        return 'rawr XD';
        
    case'Batman vs superman':
        return 'Jump scares everywhere my 4 year old son cried for 234324835.234 seconds, I counted';
        
    case'Star wars the force awakens':
        return 'hOw COUld YOU LEAVE uS HAN';
        
    case'Teen titans trouble in tokyo':
        return 'ROBIn is INNOCENT!!!!';
}

};

getReview(prompt("Movie?"));

can someone help?
'


#2

It looks like you have put any break; in your code nor a default response at the end with a break. I would suggest adding those.


#3

Just tried that:

var getReview = function (movie) {
switch(movie) {

    case'Toy Story 2':
        return 'Toys cant talk What';
    break;

    case'Godzilla':
        return 'rawr XD';
        break;
        
    case'Batman vs superman':
        return 'Jump scares everywhere my 4 year old son cried for 234324835.234 seconds, I counted';
        break;
        
    case'Star wars the force awakens':
        return 'hOw COUld YOU LEAVE uS HAN';
        break;
        
    case'Teen titans trouble in tokyo':
        return 'ROBIn is INNOCENT!!!!';
    break;
    
     default:
        return'What movie is that?'
    break;
}

};

getReview(prompt("Movie?"));

but when i fill Toy Story 2 into the prompt it says: Oops try again. Check the review of Toy Story 2


#4

Ok so I would change the reviews of Toy Sotry 2 Finding Nemo and the Lion King to what they actually wanted you to put in the review. I think your structure and organization is correct but the lesson might actually want the actual reviews. So for example Toy Story 2 would get "Great story. Mean prospector." in the return rather than what you put.


#5

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