reduce

1.0.3 • Public • Published

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.373,829latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.373,829
1.0.282,367
1.0.19,192
1.0.03
0.1.23
0.1.06

Package Sidebar

Install

npm i reduce

Weekly Downloads

165,400

Version

1.0.3

License

MIT

Unpacked Size

19.1 kB

Total Files

15

Last publish

Collaborators

  • raynos
  • ljharb