# foreach

> foreach component + npm package

Latest version **2.0.6** (published 2022-05-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install foreach
pnpm add foreach
yarn add foreach
bun add foreach
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.6 |
| Published | 2022-05-11 |
| First published | 2013-03-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/foreach) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 25 |
| Author | Manuel Stofer |
| Maintainers | manuelstofer |
| Keywords | shim, Array.prototype.forEach, forEach, Array#forEach, each |

## Links

- npm: https://www.npmjs.com/package/foreach
- Repository: https://github.com/manuelstofer/foreach
- Homepage: https://github.com/manuelstofer/foreach#readme
- Issues: https://github.com/manuelstofer/foreach/issues
- npm.io page: https://npm.io/package/foreach

## Recent versions

- 2.0.6 (latest) — 2022-05-11
- 2.0.5 — 2014-09-22
- 2.0.4 — 2013-08-19
- 2.0.3 — 2013-04-14
- 2.0.2 — 2013-04-12
- 2.0.1 — 2013-04-07
- 2.0.0 — 2013-03-22
- 1.3.3 — 2013-03-21

## README

# foreach

[![CDNJS](https://img.shields.io/cdnjs/v/foreach.svg)](https://cdnjs.com/libraries/foreach)

Iterate over the key value pairs of either an array-like object or a dictionary like object.

[![browser support][1]][2]

## API

### foreach(object, function, [context])

```js
var each = require('foreach');

each([1,2,3], function (value, key, array) {
    // value === 1, 2, 3
    // key === 0, 1, 2
    // array === [1, 2, 3]
});

each({0:1,1:2,2:3}, function (value, key, object) {
    // value === 1, 2, 3
    // key === 0, 1, 2
    // object === {0:1,1:2,2:3}
});
```

[1]: https://ci.testling.com/manuelstofer/foreach.png
[2]: https://ci.testling.com/manuelstofer/foreach

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