Skip to content

Commit

Permalink
added instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
BigKnell committed Sep 11, 2018
1 parent 934378a commit d192ca8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion assignments/array-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ let ticketPriceTotal = [];
console.log(ticketPriceTotal);

// ==== Challenge 5: Be Creative ====
// 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.
// 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.

// Problem 1

Expand Down
24 changes: 21 additions & 3 deletions assignments/callbacks.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
// 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.

const items = ['Pencil', 'Notebook', 'yo-yo', 'Gum'];

function firstItem(arr, cb) {
// firstItem passes the first item of the given array to the callback function.
}
/*
//Given this problem:
function firstItem(arr, cb) {
// firstItem passes the first item of the given array to the callback function.
}
// Potential Solution:
function firstItem(arr, cb) {
return cb(arr[0]);
}
firstItem(items, function(first) {
console.log(first)
});
*/


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

0 comments on commit d192ca8

Please sign in to comment.