var getReview = function (movie) {
var review;
switch (movie) {
case "Matrix":
review = "good trip out";
break;
case "Princess Bride":
review = "awesome date night movie";
break;
case "Welcome to America":
review = "Amjad's favorite";
break;
case "Remember the Titans":
review = "love the sports";
break;
case "Why do I look like I'm 12?":
review = "The Ryan and Zach story";
break;
case "Fighting Kangaroos in the wild":
review = "Token Australian movie for Leng";
break;
default:
review = "I don't know!";
} //end switch(movie)
return review; //return Movie review string.
}; //end getReview()
//Ask the user the name of the movie
var movieName = prompt("Type the name of a movie to get a review:");
//Print the review for the movie the user entered
console.log(getReview(movieName));
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.