Skip to content

Commit 7c14699

Browse files
authored
Fixing allCaps
Misunderstanding regarding intention of allCaps' callback.
1 parent 05da301 commit 7c14699

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

assignments/array-methods.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,7 @@ console.log(fullName);
6161

6262
// ==== Challenge 2: Use .map() ====
6363
// 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
64-
let allCaps = runners.map(x => {
65-
x.first_name = x.first_name.toUpperCase()
66-
return x;
67-
});
64+
let allCaps = runners.map(x => x.first_name.toUpperCase());
6865
console.log(allCaps);
6966

7067
// ==== Challenge 3: Use .filter() ====
@@ -93,4 +90,4 @@ runners.map(x => {
9390

9491
// Problem 3
9592
runners.filter(x => x.donation >= 100);
96-
// Filter based on minimum donation.
93+
// Filter based on minimum donation.

0 commit comments

Comments
 (0)