Question: !. Create and array of objects named movies . Each of the objects in the array will represent a movie. Each object should have properties
!. 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
release year
rating (your rating 1 - 10)
genres (an array of genres. 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
I. Now that digital format is taking 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. P. 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.
R. Use the .map() method to create an array of movie titles from our initial data set named movieTitles .
S. 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 .
U. 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 .
W. Display the following in the console with text to describe each value:
The title of each movie (hint: .join() 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
Sample output:
Movie titles: Blade Runner, Blade Runner 2049, Spectre, Sherlock Holmes, The Golden Compass
Highest rated: Blade Runner (10)
Lowest rated: The Golden Compass (5)
Highly rated: Blade Runner, Blade Runner 2049, Spectre, Sherlock Holmes
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
