Skip to content

Commit 00b9d3b

Browse files
committed
work on the array challenges
1 parent 820e299 commit 00b9d3b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

assignments/array-methods.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,23 @@ const runners = [
5656
];
5757

5858
// ==== 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.
6060
let fullNames = [];
6161
console.log(fullNames);
6262

6363
// ==== 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-
let allCaps = [];
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+
let firstNamesAllCaps = [];
66+
console.log(firstNamesAllCaps);
6767

6868
// ==== 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-
let largeShirts = [];
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+
let runnersLargeSizeShirt = [];
71+
console.log(runnersLargeSizeShirt);
7272

7373
// ==== 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-
let ticketPriceTotal = [];
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.
75+
let ticketPriceTotal = 0;
7676
console.log(ticketPriceTotal);
7777

7878
// ==== Challenge 5: Be Creative ====

0 commit comments

Comments
 (0)