functional-augments-object
v0.1.1
Published
Augment the Object prototype with methods for functional programming, including filter(), map() and reduce().
Downloads
18
Maintainers
Readme
Functional Augments for ES6 objects
This package augments the Object.prototype to provide ES6 objects with methods for functional programming similar to Arrays. Currently the following methods are provided:
- filter()
- map()
- reduce()
Installation
$ npm install --save functional-augments-object
Usage
'use strict';
require('functional-augments-object');
const object = {
one: 1,
two: 2,
three: 3
};
const reduction = object.reduce((acc, v) => acc + v);
console.log(reduction); // 6