reduce

1.0.2 • 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

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    126,252
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    126,252
  • 1.0.1
    9,913
  • 1.0.0
    6
  • 0.1.2
    1
  • 0.1.0
    0

Package Sidebar

Install

npm i reduce

Weekly Downloads

136,172

Version

1.0.2

License

none

Unpacked Size

15.6 kB

Total Files

8

Last publish

Collaborators

  • ljharb
  • raynos