You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
typesetting/pitfall/pdfkit/node_modules/foreach
Matthew Butterick 3f36e2ce2c porting 7 years ago
..
.npmignore porting 7 years ago
LICENSE porting 7 years ago
Makefile porting 7 years ago
Readme.md porting 7 years ago
component.json porting 7 years ago
index.js porting 7 years ago
package.json porting 7 years ago
test.js porting 7 years ago

Readme.md

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