Skip to content

Commit 4a422ac

Browse files
committed
solves challenge-3 in array-methods.js
1 parent a587214 commit 4a422ac

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎assignments/array-methods.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,12 @@ console.log(allCaps);
7373

7474

7575
// ==== Challenge 3: Use .filter() ====
76-
// 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
76+
// 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.
77+
// Return an array named largeShirts that contains information about the runners that have a shirt size of L and log the result
7778
let largeShirts = [];
79+
80+
largeShirts = runners.filter(runner => {return runner.shirt_size === "L"});
81+
7882
console.log(largeShirts);
7983

8084
// ==== Challenge 4: Use .reduce() ====

0 commit comments

Comments
 (0)