HEX
Server: nginx/1.28.3
System: Linux lightweb-s1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64
User: drdrivek-71 (1047)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: /home/eslinced-103/brise-edu.or.kr/node_modules/foreach/Readme.md
# 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