Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Create and array of objects named movies. Each of the objects in the array will represent a movie. Each object should have properties

image

1. Create and array of objects named movies. Each of the objects in the array will represent a movie. Each object should have properties for: movie title (string) release year (number) rating (your rating, a number 1-10) genres (an array of strings. eg ["Drama", "Mystery", "Sci-Fi", "Western"]) The array should contain at least 5 movies you have seen (choose your own movies) You can use IMDB if you need help finding the info for your movie 2. Now that digital format has taken over, we would like to add a property to each object for the format ("film" or "digital"). The property will be called "format". Assuming that all movies in our data set where shot on film, use .forEach() to add the property and set the "format" property to a value of "film" for each movie. 3. Use the .sort() method to sort the array of movies by rating, best to worst. Make sure that at least one of your movies has a rating of 10. 4. Use the .map() method to create an array of movie titles from our initial data set named movieTitles. 5. Use the .reduce() method to find the highest and lowest rated movies in the data set. Store these objects in variables named highestRated and lowestRated. 6. Use the filter() method to create an array of movies that have a rating of 7 or higher. Store this array in a variable named highlyRated. 7. Display the following in the console with text to describe each value: The title of each movie (hint: jain() to make it look nicer) The highest rated movie title and rating The lowest rated movie title and rating The titles of movies that have a rating of 7 or more

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Quantitative Methods For Business

Authors: David Anderson, Dennis Sweeney, Thomas Williams, Jeffrey Cam

11th Edition

978-0324651812, 324651813, 978-0324651751

More Books

Students also viewed these Programming questions