reduce
A better [].reduce
Last updated 6 years ago by ljharb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install reduce 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.3                                ...           latest (6 months ago)

6 Versions

  • 1.0.3                                ...           6 months ago
  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
  • 0.1.2                                ...           11 years ago
  • 0.1.0                                ...           12 years ago
Maintainers (2)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (4)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE