You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Follow these steps for completing your project.**
18
18
19
-
*[] Submit a Pull-Request to merge <firstName-lastName> Branch into master (student's Repo). **Please don't merge your own pull request**
20
-
*[] Add your team lead as a reviewer on the pull-request
21
-
*[] Your team lead will count the project as complete by merging the branch back into master.
19
+
*[x] Submit a Pull-Request to merge <firstName-lastName> Branch into master (student's Repo). **Please don't merge your own pull request**
20
+
*[x] Add your team lead as a reviewer on the pull-request
21
+
*[x] Your team lead will count the project as complete by merging the branch back into master.
22
22
23
23
## Task 1: Higher Order Functions and Callbacks
24
24
25
25
This task focuses on getting practice with higher order functions and callback functions by giving you an array of values and instructions on what to do with that array.
26
26
27
-
*[] Review the contents of the [callbacks.js](assignments/callbacks.js) file. Notice you are given an array at the top of the page. Use that array to aid you with your functions.
27
+
*[x] Review the contents of the [callbacks.js](assignments/callbacks.js) file. Notice you are given an array at the top of the page. Use that array to aid you with your functions.
28
28
29
-
*[] Complete the problems provided to you but skip over stretch problems until you are complete with every other JS file first.
29
+
*[x] Complete the problems provided to you but skip over stretch problems until you are complete with every other JS file first.
30
30
31
31
## Task 2: Array Methods
32
32
33
33
Use `.forEach()`, `.map()`, `.filter()`, and `.reduce()` to loop over an array with 50 objects in it. The [array-methods.js](assignments/array-methods.js) file contains several challenges built around a fundraising 5K fun run event.
34
34
35
-
*[] Review the contents of the [array-methods.js](assignments/array-methods.js) file.
35
+
*[x] Review the contents of the [array-methods.js](assignments/array-methods.js) file.
36
36
37
-
*[] Complete the problems provided to you but skip over stretch problems until you are complete with every other JS file first.
37
+
*[x] Complete the problems provided to you but skip over stretch problems until you are complete with every other JS file first.
38
38
39
-
*[] Notice the last three problems are up to you to create and solve. This is an awesome opportunity for you to push your critical thinking about array methods, have fun with it.
39
+
*[x] Notice the last three problems are up to you to create and solve. This is an awesome opportunity for you to push your critical thinking about array methods, have fun with it.
40
40
41
41
## Task 3: Closures
42
42
43
43
We have learned that closures allow us to access values in scope that have already been invoked (lexical scope).
44
44
45
45
**Hint: Utilize debugger statements in your code in combination with your developer tools to easily identify closure values.**
46
46
47
-
*[] Review the contents of the [closure.js](assignments/closure.js) file.
48
-
*[] Complete the problems provided to you but skip over stretch problems until you are complete with every other JS file first.
47
+
*[x] Review the contents of the [closure.js](assignments/closure.js) file.
48
+
*[x] Complete the problems provided to you but skip over stretch problems until you are complete with every other JS file first.
49
49
50
50
## Stretch Goals
51
51
52
-
*[] Go back through the stretch problems that you skipped over and complete as many as you can.
53
-
*[] Look up what an IIFE is in JavaScript and experiment with them
52
+
*[x] Go back through the stretch problems that you skipped over and complete as many as you can.
53
+
*[x] Look up what an IIFE is in JavaScript and experiment with them
// 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.
// 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.
// 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. This will be an array of objects.
70
-
letrunnersLargeSizeShirt=[];
76
+
letrunnersLargeSizeShirt=runners.filter(runner=>{
77
+
returnrunner.shirt_size==="L";
78
+
});
71
79
console.log(runnersLargeSizeShirt);
72
80
73
81
// ==== Challenge 4: Use .reduce() ====
74
82
// 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.
// 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.
80
90
81
-
// Problem 1
91
+
// Problem 1: You decide to give flowers to the top three donors. Produce an array of the top three runner objects, ranked in descending order of size of donation.
// Problem 3: You decide that companies whose names begin with "W" or end in "le" are morally reprehensible, and that it would be criminal to accept their money. Remove them from runners. (Do not mutuate.)
0 commit comments