# array-reduce

> `[].reduce()` for old browsers

Latest version **0.0.0** (published 2013-12-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install array-reduce
pnpm add array-reduce
yarn add array-reduce
bun add array-reduce
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.0 |
| Published | 2013-12-25 |
| First published | 2013-12-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | James Halliday |
| Maintainers | substack |
| Keywords | array, reduce, es5, ie6, ie7, ie8, fold |

## Links

- npm: https://www.npmjs.com/package/array-reduce
- Repository: https://github.com/substack/array-reduce
- Issues: https://github.com/substack/array-reduce/issues
- npm.io page: https://npm.io/package/array-reduce

## Recent versions

- 0.0.0 (latest) — 2013-12-25

## README

# array-reduce

`[].reduce()` for old browsers

[![testling badge](https://ci.testling.com/substack/array-reduce.png)](https://ci.testling.com/substack/array-reduce)

[![build status](https://secure.travis-ci.org/substack/array-reduce.png)](http://travis-ci.org/substack/array-reduce)

# 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

``` js
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](https://npmjs.org) do:

```
npm install array-reduce
```

# license

MIT

---
_Source: https://npm.io/package/array-reduce · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
