A javascript library for working with objects
Builds a new object by iterating over own properties of an object.
Returns: Object
| *
- If null or undefined are passed in then the same is returned, otherwise a new object
Param | Type | Description |
---|---|---|
object | Object |
|
callback | function |
Provides two args: value and key |
[ignoreKeys] | Array , String |
Any keys in this array will be ignored |
Example
import { mapOwn } from 'object-agent';
const thing = {
a: 'b',
c: 'd'
};
mapOwn(thing, (value, key) => value + ' ' + key);
// => { a: 'b a', c: 'd c' }