No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
rpm-mcarman b9f7ec4306 First Commit hace 3 años
..
example First Commit hace 3 años
test First Commit hace 3 años
.travis.yml First Commit hace 3 años
LICENSE First Commit hace 3 años
index.js First Commit hace 3 años
package.json First Commit hace 3 años
readme.markdown First Commit hace 3 años

readme.markdown

array-reduce

[].reduce() for old browsers

testling badge

build status

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

methods

var reduce = require('array-reduce')

var res = reduce(xs, f, init)

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.

install

With npm do:

npm install array-reduce

license

MIT