Skip to content

Commit dcaa811

Browse files
committed
Corrected Array Methods
1 parent 8fdc6aa commit dcaa811

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎assignments/array-methods.js‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,17 @@ console.log(fullName);
6666
// ==== Challenge 2: Use .map() ====
6767
// 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
6868
// let allCaps = [];
69-
const allCaps = runners.map(function() {
70-
"first_name".toUpperCase
71-
});
69+
let allCaps = runners.map(function(items) {
70+
return items.first_name.toUpperCase();
71+
});
7272

7373
console.log(allCaps);
7474

7575
// ==== Challenge 3: Use .filter() ====
7676
// 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
7777
// let largeShirts = [];
78-
const largeShirts = runners.filter(data => {
79-
return "shirt_size" === "L";
78+
const largeShirts = runners.filter((data) => {
79+
return data.shirt_size === "L";
8080
});
8181

8282
console.log(largeShirts);

0 commit comments

Comments
 (0)