tree: a54e5f566d0b68a181ec1e9e4df17f73a36a7eea [path history] [tgz]
  1. .github/
  2. test/
  3. .editorconfig
  4. .eslintrc
  5. .nycrc
  6. CHANGELOG.md
  7. index.d.ts
  8. index.js
  9. LICENSE
  10. package.json
  11. README.md
  12. tsconfig.json
node_modules/for-each/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