In index.js
, write functions that do the following:
- Print all the songs
- Print all the movies
- Return an array of all Beyonce's hit song titles
- Return an array of all Beyonce's fierceness ratings
- Return all the songs where Beyonce is wearing a bodysuit or a bodysuit is part of the video theme
- Return an array with all of the songs where Beyonce's fierceness is greater than or equal to a given number
- Return an array with all of the movies Beyonce made in 2006 and after
- Return all the hit songs where Beyonce was in a group
- Return a hit song where Beyonce's hair is blonde
- Return the hit song "Sorry"
- Return a given song
- Return all hit songs where Beyonce's fierceness rating is 10
- Return the sum of Beyonce's fierceness value for all of her hit songs
- Return the average fierceness value for all of her hit songs
- Return the sum of Beyonce's rating value for all of her movies
- Return the average rating value for all of her movies
- Return the sum of the total number of dancers in all of the hit song videos
- Return an array of Beyonce's hairstyles without repeats
- Return an object where the properties are song names and the value is an object which contains that song's fierceness and the average fierceness for all songs
- Return an object where the properties are movie names and the value is an object which contains that movie's rating and the average rating for all movies
- Return an object with Beyonce's hairstyles as the keys and a tally of each hairstyle, eg.
{ "blonde": 3, ... }
Note that you can and should reuse your functions and you can write more functions to further break up your work.
You can test your functions by calling them at the bottom of the file and running node index.js
.