auth-api/tests/node_modules/foreach
2021-06-23 22:30:45 +02:00
..
.npmignore Added some tests 2021-06-23 22:30:45 +02:00
component.json Added some tests 2021-06-23 22:30:45 +02:00
index.js Added some tests 2021-06-23 22:30:45 +02:00
LICENSE Added some tests 2021-06-23 22:30:45 +02:00
Makefile Added some tests 2021-06-23 22:30:45 +02:00
package.json Added some tests 2021-06-23 22:30:45 +02:00
Readme.md Added some tests 2021-06-23 22:30:45 +02:00
test.js Added some tests 2021-06-23 22:30:45 +02:00

foreach

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

browser support

API

foreach(object, function, [context])

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}
});