1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1× 3× 8× 3× | /* * Collection helpers. * * For each of these functions, call it in the context of an object that responds to `forEach`. */ module.exports = { map (fn) { const result = [] this.forEach(function () { result.push(fn.apply(this, arguments)) }) return result } } |