I Have to Celebrate you Baby. (Reviews error?)



So my code is fine as long as I can see except that a get the error: Oops, try again. Check the review of Toy Story 2. And I literally copy-paste the 3 reviews. I don't know what to do...
I also was wondering why am I asked to write 3 times the name of the movie I want to get the review from and not just once? Thanks to anyone that could help me

var getReview = function (movie) {
var movie = prompt("Toy Story 2, Finding Nemo or The Lion King");
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.";
    return "I don't know!";


The string on that line should be "I just don't know!" and not "I don't know!"


Well the instructions say that you should write "I don't know!" not otherwise. I also copy-paste ed that part. And just to verify i did as you said and the mistake keeps targeting the toy story review


so, you already create a function with 1 parameter, but when you call it you dont give any parameter to that

getReview(); ---Should be--> getReview("Toy Story 2");

you dont need a prompt to take a value because it will be passed by the function argument

try to do this and let me know if it works!


I changed the parameter to toy story and now the error follows the Nemo review


Show me your updated code


And now back again in Toy Story
Please tell me if you san see the image i'm posting
First time I ran it, the error would mention the nemo review, I don't know what it changed


take the line 2 off, it seems you are overwriting your "var movie"


Well without the prompt command it now works, why is that?


this exercise is very simple. it's just to remember concept of functions and switchs

your code works because your function expects one parameter, and your switch are using that parameter, because of that you dont need prompt to your code works


What is the problem in my code????????


No need of break in default statement. Try removing Line 14 --> "break;"


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