Skip to content

Commit 0f2c5fd

Browse files
committed
add first callback
1 parent d6e7ed5 commit 0f2c5fd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

assignments/callbacks.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,13 @@ const items = ['Pencil', 'Notebook', 'yo-yo', 'Gum'];
2424

2525
function getLength(arr, cb) {
2626
// getLength passes the length of the array into the callback.
27+
return cb(arr.length);
2728
}
2829

30+
getLength(items, function(length){
31+
console.log(length)
32+
});
33+
2934
function last(arr, cb) {
3035
// last passes the last item of the array into the callback.
3136
}

0 commit comments

Comments
 (0)