sensordb2 e64a8defe5 3.17 | 1 year ago | |
---|---|---|
.. | ||
.npmignore | 1 year ago | |
LICENSE | 1 year ago | |
Makefile | 1 year ago | |
Readme.md | 1 year ago | |
component.json | 1 year ago | |
index.js | 1 year ago | |
package.json | 1 year ago | |
test.js | 1 year 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}
});