Skip to content

Commit 9bccd06

Browse files
committed
compleed challenge 1 of array-methods.js
1 parent 895e522 commit 9bccd06

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

‎assignments/array-methods.js‎

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,36 @@ const runners = [{"id":1,"first_name":"Charmain","last_name":"Seiler","email":"c
6060

6161
let fullName = [];
6262
console.log(fullName);
63-
runners.forEach(function(runners."first_name")
63+
64+
runners.forEach(function(getNames){
65+
let names = getNames.first_name + " " + getNames.last_name;
66+
fullName.push(names)
67+
console.log(names)
68+
});
69+
6470
// ==== Challenge 2: Use .map() ====
65-
// 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
71+
// The event director needs to have all the runner's first names converted to uppercase because the director BECAME DRUNK WITH POWER.
72+
// Convert each first name into all caps and log the result
6673
let allCaps = [];
6774
console.log(allCaps);
6875

6976
// ==== Challenge 3: Use .filter() ====
70-
// 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
77+
// The large shirts won't be available for the event due to an ordering issue.
78+
//Get a list of runners with large sized shirts so they can choose a different size.
79+
//Return an array named largeShirts that contains information about the runners that have a shirt size of L and log the result
7180
let largeShirts = [];
7281
console.log(largeShirts);
7382

7483
// ==== Challenge 4: Use .reduce() ====
75-
// 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
84+
// The donations need to be tallied up and reported for tax purposes.
85+
//Add up all the donations into a ticketPriceTotal array and log the result
7686
let ticketPriceTotal = [];
7787
console.log(ticketPriceTotal);
7888

7989
// ==== Challenge 5: Be Creative ====
80-
// Now that you have used .forEach(), .map(), .filter(), and .reduce(). I want you to think of potential problems you could solve given the data set and the 5k fun run theme. Try to create and then solve 3 unique problems using one or many of the array methods listed above.
90+
// Now that you have used .forEach(), .map(), .filter(), and .reduce().
91+
// I want you to think of potential problems you could solve given the data set and the 5k fun run theme.
92+
//Try to create and then solve 3 unique problems using one or many of the array methods listed above.
8193

8294
// Problem 1
8395

0 commit comments

Comments
 (0)