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
Copy file name to clipboardExpand all lines: assignments/array-methods.js
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -56,23 +56,23 @@ const runners = [
56
56
];
57
57
58
58
// ==== Challenge 1: Use .forEach() ====
59
-
// The event director needs both the first and last names of each runner for their running bibs. Combine both the first and last names and populate a new array called fullNames. This array contains just strings.
59
+
// The event director needs both the first and last names of each runner for their running bibs. Combine both the first and last names and populate a new array called `fullNames`. This array will contain just strings.
60
60
letfullNames=[];
61
61
console.log(fullNames);
62
62
63
63
// ==== Challenge 2: Use .map() ====
64
-
// 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
65
-
letallCaps=[];
66
-
console.log(allCaps);
64
+
// The event director needs to have all the runners' first names in uppercase because the director BECAME DRUNK WITH POWER. Populate an array called `firstNamesAllCaps`. This array will contain just strings.
65
+
letfirstNamesAllCaps=[];
66
+
console.log(firstNamesAllCaps);
67
67
68
68
// ==== Challenge 3: Use .filter() ====
69
-
// 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
70
-
letlargeShirts=[];
71
-
console.log(largeShirts);
69
+
// The large shirts won't be available for the event due to an ordering issue. We need a filtered version of the runners array, containing only those runners with large sized shirts so they can choose a different size.
70
+
letrunnersLargeSizeShirt=[];
71
+
console.log(runnersLargeSizeShirt);
72
72
73
73
// ==== Challenge 4: Use .reduce() ====
74
-
// 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
75
-
letticketPriceTotal=[];
74
+
// The donations need to be tallied up and reported for tax purposes. Add up all the donations and save the total into a ticketPriceTotal variable.
0 commit comments