Skip to content

Commit 1fead6b

Browse files
committed
working on arrays.js
1 parent e8a6789 commit 1fead6b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/arrays.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ const each = (elements, cb) => {
1414
// This only needs to work with arrays.
1515
// You should also pass the index into `cb` as the second argument
1616
// based off http://underscorejs.org/#each
17+
for (let i = 0; i < elements.length; i++) {
18+
cb(elements[i], i);
19+
}
1720
};
1821

1922
const map = (elements, cb) => {

0 commit comments

Comments
 (0)