reduce

A better [].reduce

  • reduce

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
reduce
1201.0.25 years ago12 years agoMinified + gzip package size for reduce in KB

Readme

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

travis-svg: https://secure.travis-ci.org/Raynos/reduce.svg travis-url: https://travis-ci.org/Raynos/reduce