Skip to content

Commit d192ca8

Browse files
committed
added instruction
1 parent 934378a commit d192ca8

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

assignments/array-methods.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ let ticketPriceTotal = [];
7474
console.log(ticketPriceTotal);
7575

7676
// ==== Challenge 5: Be Creative ====
77-
// 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 solve 3 unique problems using one or many of the array methods listed above.
77+
// 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.
7878

7979
// Problem 1
8080

assignments/callbacks.js

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
1+
// Create a callback function and invoke the function to test your work. You have been provided an example of a problem and a solution to see how this works with our items array. Study both the problem and the solution to figure out the rest of the problems.
2+
13
const items = ['Pencil', 'Notebook', 'yo-yo', 'Gum'];
24

3-
function firstItem(arr, cb) {
4-
// firstItem passes the first item of the given array to the callback function.
5-
}
5+
/*
6+
7+
//Given this problem:
8+
9+
function firstItem(arr, cb) {
10+
// firstItem passes the first item of the given array to the callback function.
11+
}
12+
13+
// Potential Solution:
14+
function firstItem(arr, cb) {
15+
return cb(arr[0]);
16+
}
17+
18+
firstItem(items, function(first) {
19+
console.log(first)
20+
});
21+
22+
*/
23+
624

725
function getLength(arr, cb) {
826
// getLength passes the length of the array into the callback.

0 commit comments

Comments
 (0)