for-each ![build status](https://camo.githubusercontent.com/ab0e4a021dd65416612307c16834820c84d3e5c78ccc70f4dcaf6b8512c16ade/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f5261796e6f732f666f722d656163682e706e67)
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