RevelaOS/node_modules/for-each
2023-10-15 23:53:41 +01:00
..
test [🎉] Initial Commit 2023-10-15 23:53:41 +01:00
.editorconfig [🎉] Initial Commit 2023-10-15 23:53:41 +01:00
.eslintrc [🎉] Initial Commit 2023-10-15 23:53:41 +01:00
.travis.yml [🎉] Initial Commit 2023-10-15 23:53:41 +01:00
index.js [🎉] Initial Commit 2023-10-15 23:53:41 +01:00
LICENSE [🎉] Initial Commit 2023-10-15 23:53:41 +01:00
package.json [🎉] Initial Commit 2023-10-15 23:53:41 +01:00
README.md [🎉] Initial Commit 2023-10-15 23:53:41 +01:00

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

Contributors

  • Raynos

MIT Licenced