Package: wnpp
Severity: wishlist
Owner: Shirish Togarla <
shirishtogarla533@gmail.com>
X-Debbugs-CC:
debian-devel@lists.debian.org* Package name : node-array-reduce
Version : 0.0.0
Upstream Author : James Halliday <
mail@substack.net> (
http://substack.net)
* URL :
https://github.com/substack/array-reduce* License : Expat
Programming Lang: _javascript_
Description : `[].reduce()` for old browsers
Create a result `res` by folding `acc = f(acc, xs[i], i)` over each element in
the array `xs` at element `i`. If `init` is given, the first `acc` value is
`init`, otherwise `xs[0]` is used. For example
var reduce = require('array-reduce');
var xs = [ 1, 2, 3, 4 ];
var sum = reduce(xs, function (acc, x) { return acc + x }, 0);
console.log(sum);
Output:
10