1 2 3 4 5 6 7 8 9 | 1× 1× 55× 55× 198× 55× | const forEach = require('./each') module.exports = function map (each, fn) { if (typeof each !== 'function') each = forEach.bind(this, each) const result = [] each(function () { result.push(fn.apply(this, arguments)) }) return result } |