hensei-web/node_modules/foreach
2020-09-11 06:44:42 -07:00
..
.npmignore First commit 2020-09-11 06:44:42 -07:00
component.json First commit 2020-09-11 06:44:42 -07:00
index.js First commit 2020-09-11 06:44:42 -07:00
LICENSE First commit 2020-09-11 06:44:42 -07:00
Makefile First commit 2020-09-11 06:44:42 -07:00
package.json First commit 2020-09-11 06:44:42 -07:00
Readme.md First commit 2020-09-11 06:44:42 -07:00
test.js First commit 2020-09-11 06:44:42 -07: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}
});