caoge c760052ff9 机车状态修改 | il y a 8 mois | |
---|---|---|
.. | ||
test | il y a 8 mois | |
.editorconfig | il y a 8 mois | |
.eslintrc | il y a 8 mois | |
.travis.yml | il y a 8 mois | |
LICENSE | il y a 8 mois | |
README.md | il y a 8 mois | |
index.js | il y a 8 mois | |
package.json | il y a 8 mois |
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