Package Exports
- poly-reduce
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (poly-reduce) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
poly-reduce
Use reduce with not only Arrays but also with Objects in Javascript.
Examples
var reduce = require('poly-reduce');
var arr = [
1,
2,
3,
4,
5
]
function callback(accum, item) {
return accum + item;
}
reduce(callback, 0, arr); // 15
var = obj {
one: 1,
two: 2,
three: 3,
four: 4,
five: 5
}
reduce(callback, 0, obj); // 15Test
npm test