Map an object or array.
$ component install ianstormtaylor/map
$ npm install ianstormtaylor/map
Arrays:
var map = require('map');
map([1, 2, 3], function (val, i) {
return 10 + val;
});
// [11, 12, 13]
Objects:
var map = require('map');
map({ a: 1, b: 2, c: 3 }, function (key, val) {
return 10 + val;
});
// [11, 12, 13]
Map the obj
using an iterator
.
MIT