UNPKG

241 BJavaScriptView Raw
1var forEach = require('./each')
2
3module.exports = function map (each, fn) {
4 if (typeof each !== 'function') each = forEach.bind(this, each)
5 var result = []
6 each(function () { result.push(fn.apply(this, arguments)) })
7 return result
8}