You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xuma
061bf09bc8
|
2 years ago | |
---|---|---|
.. | ||
test | 2 years ago | |
.editorconfig | 2 years ago | |
.eslintrc | 2 years ago | |
.travis.yml | 2 years ago | |
LICENCE | 2 years ago | |
README.md | 2 years ago | |
index.js | 2 years ago | |
package.json | 2 years ago |
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