lhl 2bdf874dbb create 1 month ago
..
.github 2bdf874dbb create 1 month ago
test 2bdf874dbb create 1 month ago
.editorconfig 2bdf874dbb create 1 month ago
.eslintrc 2bdf874dbb create 1 month ago
.nycrc 2bdf874dbb create 1 month ago
CHANGELOG.md 2bdf874dbb create 1 month ago
LICENSE 2bdf874dbb create 1 month ago
README.md 2bdf874dbb create 1 month ago
index.d.ts 2bdf874dbb create 1 month ago
index.js 2bdf874dbb create 1 month ago
package.json 2bdf874dbb create 1 month ago
tsconfig.json 2bdf874dbb create 1 month ago

README.md

for-each build status

browser support

A better forEach.

Example

Like Array.prototype.forEach but works on objects.

var forEach = require("for-each")

forEach({ key: "value" }, function (value, key, object) {
    /* code */
})

As a bonus, it's also a perfectly function shim/polyfill for arrays too!

var forEach = require("for-each")

forEach([1, 2, 3], function (value, index, array) {
    /* code */
})

Installation

npm install for-each

MIT Licenced