José Quiñones Flores 4564da0130 Added Laravel project and removed sensitive data | 4 lat temu | |
---|---|---|
.. | ||
index.js | 4 lat temu | |
license | 4 lat temu | |
package.json | 4 lat temu | |
readme.md | 4 lat temu |
Map object keys and values into a new object
$ npm install --save map-obj
var mapObj = require('map-obj');
var newObject = mapObj({foo: 'bar'}, function (key, value, object) {
// first element is the new key and second is the new value
// here we reverse the order
return [value, key];
});
//=> {bar: 'foo'}
MIT © Sindre Sorhus