root 7621d6d22a 221005-1449-Kim | 2 years ago | |
---|---|---|
.. | ||
.npmignore | 2 years ago | |
LICENSE | 2 years ago | |
Makefile | 2 years ago | |
Readme.md | 2 years ago | |
component.json | 2 years ago | |
index.js | 2 years ago | |
package.json | 2 years ago | |
test.js | 2 years ago |
Iterate over the key value pairs of either an array-like object or a dictionary like object.
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}
});