Skip to content

Commit 7f2c53c

Browse files
committed
COmpleted all challenges except stretch problem
1 parent 6734c3f commit 7f2c53c

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

assignments/callbacks.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const items = ['Pencil', 'Notebook', 'yo-yo', 'Gum'];
4949
// console.log(final);
5050
// });
5151

52-
// //My Solution
52+
// //My Solution:
5353
// function sumNums(x, y, cb) {
5454
// // sumNums adds two numbers (x, y) and passes the result to the callback.
5555
// return cb(x+y);
@@ -58,7 +58,7 @@ const items = ['Pencil', 'Notebook', 'yo-yo', 'Gum'];
5858
// console.log(sum);
5959
// });
6060

61-
// //My Solution
61+
// //My Solution:
6262
// function multiplyNums(x, y, cb) {
6363
// // multiplyNums multiplies two numbers and passes the result to the callback.
6464
// return cb(x*y)
@@ -68,11 +68,18 @@ const items = ['Pencil', 'Notebook', 'yo-yo', 'Gum'];
6868
// console.log(times);
6969
// });
7070

71-
function contains(item, list, cb) {
72-
// contains checks if an item is present inside of the given array/list.
73-
// Pass true to the callback if it is, otherwise pass false.
74-
//return cb(list.filter(list.item))
75-
}
71+
// //My Solution:
72+
// function contains(item, list, cb) {
73+
// // contains checks if an item is present inside of the given array/list.
74+
// // Pass true to the callback if it is, otherwise pass false.
75+
// return cb(list.filter(pops=>pops===item));
76+
// }
77+
78+
// contains('Notebook', items, function(has){
79+
// console.log(has);
80+
// });
81+
82+
7683
/* STRETCH PROBLEM */
7784

7885
function removeDuplicates(array, cb) {

0 commit comments

Comments
 (0)