|
|
3 年之前 | |
|---|---|---|
| .. | ||
| .npmignore | 3 年之前 | |
| LICENSE | 3 年之前 | |
| Makefile | 3 年之前 | |
| Readme.md | 3 年之前 | |
| component.json | 3 年之前 | |
| index.js | 3 年之前 | |
| package.json | 3 年之前 | |
| test.js | 3 年之前 | |
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}
});