prop-assign
v1.0.0
Published
Assign a value to a property in an Array iterator
Downloads
2,046
Maintainers
Readme
prop-assign
Assign a value to a property in an Array iterator
$ npm install --save prop-assign
var propAssign = require('prop-assign');
var users = [
{ id: 1, name: 'Dave' },
{ id: 2, name: 'Stephen' }
];
users.map(propAssign('time', Date.now()));
// [
// { id: 1, name: 'Dave', time: [Date] },
// { id: 2, name: 'Stephen', time: [Date] },
// ]