forked from bloominstituteoftechnology/JavaScript-II
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const items = ['Pencil', 'Notebook', 'yo-yo', 'Gum']; | ||
|
||
function firstItem(arr, cb) { | ||
// firstItem passes the first item of the given array to the callback function. | ||
} | ||
|
||
function getLength(arr, cb) { | ||
// getLength passes the length of the array into the callback. | ||
} | ||
|
||
function last(arr, cb) { | ||
// last passes the last item of the array into the callback. | ||
} | ||
|
||
function sumNums(x, y, cb) { | ||
// sumNums adds two numbers (x, y) and passes the result to the callback. | ||
} | ||
|
||
function multiplyNums(x, y, cb) { | ||
// multiplyNums multiplies two numbers and passes the result to the callback. | ||
} | ||
|
||
function contains(item, list, cb) { | ||
// contains checks if an item is present inside of the given array/list. | ||
// Pass true to the callback if it is, otherwise pass false. | ||
} | ||
|
||
/* STRETCH PROBLEM */ | ||
|
||
function removeDuplicates(array, cb) { | ||
// removeDuplicates removes all duplicate values from the given array. | ||
// Pass the duplicate free array to the callback function. | ||
// Do not mutate the original array. | ||
} |