Skip to content

Commit 112bb31

Browse files
committed
feat(js): honorary map array fn
1 parent de0c244 commit 112bb31

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const map = (arr, cb) => {
2+
let i = arr.length, result = Array(i);
3+
while (i--) result[i] = cb(arr[i], i, arr);
4+
return result;
5+
};

0 commit comments

Comments
 (0)