Skip to content

Commit 1f2b704

Browse files
committed
Answered some project 4 problems
1 parent 54ad8ae commit 1f2b704

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/project-4.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ const getFirstItem = (collection, cb) => {
55

66
const getLength = (collection, cb) => {
77
// Write a function called getLength that passes the length of the array into the callback
8+
cb(collection.length);
89
};
910

1011
const getLastItem = (collection, cb) => {
1112
// Write a function called getLastItem which passes the getLastItem item of the array into the callback
13+
cb(collection[collection.length - 1]);
1214
};
1315

1416
const sumNums = (x, y, cb) => {

0 commit comments

Comments
 (0)