blob: d36c48d88cacb37e860f225d4f4cf88a341b6ffc [file] [log] [blame]
module.exports = function (xs, f) {
if (xs.map) return xs.map(f);
var res = [];
for (var i = 0; i < xs.length; i++) {
var x = xs[i];
if (hasOwn.call(xs, i)) res.push(f(x, i, xs));
}
return res;
};
var hasOwn = Object.prototype.hasOwnProperty;