Luis f4296bcada project initialized | 5 years ago | |
---|---|---|
.. | ||
test | 5 years ago | |
.editorconfig | 5 years ago | |
.eslintrc | 5 years ago | |
.travis.yml | 5 years ago | |
LICENSE | 5 years ago | |
README.md | 5 years ago | |
index.js | 5 years ago | |
package.json | 5 years ago |
A better forEach.
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 */
})
npm install for-each