You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7a4cec7
Browse filesBrowse the repository at this point in the historyBrowse files
// The event director needs both the first and last names of each runner for their running bibs. Combine both the first and last names into a new array called fullName.
// The event director needs to have all the runner's first names converted to uppercase because the director BECAME DRUNK WITH POWER. Convert each first name into all caps and log the result
63
-
letallCaps=[];
64
-
console.log(allCaps);
66
+
letallCaps=runners.map(function(runner){
67
+
returnrunner.first_name.toUpperCase();
68
+
})
69
+
//console.log(allCaps);
65
70
66
71
// ==== Challenge 3: Use .filter() ====
67
72
// The large shirts won't be available for the event due to an ordering issue. Get a list of runners with large sized shirts so they can choose a different size. Return an array named largeShirts that contains information about the runners that have a shirt size of L and log the result
68
-
letlargeShirts=[];
69
-
console.log(largeShirts);
73
+
letlargeShirts=runners.filter(function(runner){
74
+
returnrunner.shirt_size==="L";
75
+
});
76
+
//console.log(largeShirts);
70
77
71
78
// ==== Challenge 4: Use .reduce() ====
72
79
// The donations need to be tallied up and reported for tax purposes. Add up all the donations into a ticketPriceTotal array and log the result
// Now that you have used .forEach(), .map(), .filter(), and .reduce(). I want you to think of potential problems you could solve given the data set and the 5k fun run theme. Try to create and then solve 3 unique problems using one or many of the array methods listed above.
78
87
79
-
// Problem 1
88
+
// Problem 1 I want a email list that has the first name, last name, email and company name
// Problem 3 all runners that first names start with C. This organizer 's name starts with C so he likes it when someone's name starts with C. He wants to give a headstart to these people so get him a list.
0 commit comments