reduce
A better [].reduce
Last updated 7 years ago by ljharb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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.2                                ...           latest (7 years ago)

5 Versions

  • 1.0.2                                ...           7 years ago
  • 1.0.1                                ...           12 years ago
  • 1.0.0                                ...           12 years ago
  • 0.1.2                                ...           13 years ago
  • 0.1.0                                ...           14 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (1)
Dev Dependencies (4)
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |