reduce

A better [].reduce

MIT License

Downloads
784.2K
Stars
12
Committers
2

reduce build status

Example

Like Array.prototype.reduce but works on Object and accepts optional this value

var reduce = require("reduce")

reduce({
    key: "value"
    , key2: "value2"
    , ...
}, function (acc, value, key) {
    /* real code */
    acc[key] = value
    return acc
}, {
    this: "context"
}, {
    initial: "value"
})

Installation

npm install reduce

Contributors

  • Raynos

MIT Licenced

Package Rankings
Top 3.26% on Npmjs.org
Badges
Extracted from project README
build status