mirror of https://gitee.com/antv-l7/antv-l7
f7e5376b7d | ||
---|---|---|
.. | ||
test | ||
.editorconfig | ||
.eslintrc | ||
.travis.yml | ||
LICENCE | ||
README.md | ||
index.js | ||
package.json |
README.md
reduce
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