- License
- MIT
- Install Size
- 23.9 kB(52.9 kB)
- Vulns
- 0
- Published
$
npm install for-each$
pnpm add for-each$
yarn add for-each$
bun add for-each$
deno add npm:for-each$
vlt install for-each$
vp add for-eachYou might not need this dependency.
This package can be replaced with for...of (using Object.entries if dealing with objects), available since Node 0.12.0.Learn more
for-each 
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
