Skip to content

Commit 94daed2

Browse files
Started JavaScript II
1 parent afae86b commit 94daed2

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

assignments/callbacks.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const items = ['Pencil', 'Notebook', 'yo-yo', 'Gum'];
77
//Given this problem:
88
99
function firstItem(arr, cb) {
10-
// firstItem passes the first item of the given array to the callback function.
10+
// firstItem passes the first item of the given array to the callback function.
1111
}
1212
1313
// Potential Solution:
@@ -18,35 +18,35 @@ const items = ['Pencil', 'Notebook', 'yo-yo', 'Gum'];
1818
firstItem(items, function(first) {
1919
console.log(first)
2020
});
21-
2221
*/
2322

2423

24+
2525
function getLength(arr, cb) {
26-
// getLength passes the length of the array into the callback.
26+
// getLength passes the length of the array into the callback.
2727
}
2828

2929
function last(arr, cb) {
30-
// last passes the last item of the array into the callback.
30+
// last passes the last item of the array into the callback.
3131
}
3232

3333
function sumNums(x, y, cb) {
34-
// sumNums adds two numbers (x, y) and passes the result to the callback.
34+
// sumNums adds two numbers (x, y) and passes the result to the callback.
3535
}
3636

3737
function multiplyNums(x, y, cb) {
38-
// multiplyNums multiplies two numbers and passes the result to the callback.
38+
// multiplyNums multiplies two numbers and passes the result to the callback.
3939
}
4040

4141
function contains(item, list, cb) {
42-
// contains checks if an item is present inside of the given array/list.
43-
// Pass true to the callback if it is, otherwise pass false.
42+
// contains checks if an item is present inside of the given array/list.
43+
// Pass true to the callback if it is, otherwise pass false.
4444
}
4545

4646
/* STRETCH PROBLEM */
4747

4848
function removeDuplicates(array, cb) {
49-
// removeDuplicates removes all duplicate values from the given array.
50-
// Pass the duplicate free array to the callback function.
51-
// Do not mutate the original array.
52-
}
49+
// removeDuplicates removes all duplicate values from the given array.
50+
// Pass the duplicate free array to the callback function.
51+
// Do not mutate the original array.
52+
}

0 commit comments

Comments
 (0)