Mock Data Batch 1 Mock Data Batch 2
Make a page called functional_exercises.html Save both .json files into your project's ./data/ folder Use an ajax GET request to read the contents of both .json files.
-
Combine both arrays of objects into a single array. Name that variable users.
-
Use .reduce to get a sum total of every price from each object. Call that sum "totalPrices"
-
Use the users array and .reduce to determine how many shirts of each size we'll need to get. Example output should looks something like the following (numbers aren't exact) { "S": 200, "M": 892, "L": 290, "XL": 442 }
-
Produce a new array of objects w/ only the car info. Call this array allCars. Each object should only have the make, model, color, price, used properties
-
Produce a single object called car_data w/ the following properties
avg_price
,avg_new_price
,avg_used_price
,top_make
,top_model
,total_number
,number_used
,number_new
,highest_price
,lowest_price
-
Make an array called admins that contains only users who are admins
-
Make an array called authors that contains only users who are authors
-
Make an object called departments. That departments object should have a property for each department name. The value for each department name should be an array of user objects containing firstName, lastName, department, email, and buzzword
{ "legal": [ {"first_name": "Jane", "email":"jane@jane.com", "buzzword":"activating motivators!"}, {"first_name": "Bob", "email":"bob@bob.com", "buzzword":"telegraphing bankers"} ], "marketing": [ {"first_name": "Marsha", "email":"marsh@sha256.com", "buzzword":"securing wonder"}, {"first_name": "Pat", "email":"itspat@patrocks.com", "buzzword":"whatever works"} ], etc ... }