UNPKG

@jrc03c/js-math-tools

Version:
10 lines (7 loc) 138 B
function reduce(x, fn, out) { for (let i = 0; i < x.length; i++) { out = fn(out, x[i], i, x) } return out } export { reduce }