Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Foreach component + npm package
JavaScript
branch: master
Failed to load latest commit information.
.gitignore Ignoring node_modules, since this is an npm module.
.npmignore Renames repo from `each` to `foreach` (available on npm)
LICENSE Add proper MIT LICENSE file
Makefile Initial import
Readme.md Add testling data.
component.json Bumps version to 2.0.5
index.js
package.json Bumps version to 2.0.5
test.js

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}
});
Something went wrong with that request. Please try again.