Skip to content

Commit afada05

Browse files
author
Courtney Seitz
committed
more arrays
1 parent 6f44313 commit afada05

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/arrays.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ const reduce = (elements, cb, startingValue) => {
3131
// `startingValue` is the starting value. If `startingValue` is undefined then make `elements[0]` the initial value.
3232

3333
const find = (elements, cb) => {
34+
elements.forEach((element) => {
35+
cb(elements.findIndex);
36+
37+
});
38+
};
3439
// Look through each value in `elements` and pass each element to `cb`.
3540
// If `cb` returns `true` then return that element.
3641
// Return `undefined` if no elements pass the truth test.
37-
};
3842

3943
const filter = (elements, cb) => {
4044
// Similar to `find` but you will return an array of all elements that passed the truth test

0 commit comments

Comments
 (0)