npm.io
1.1.0 • Published 8 years ago

seebigs-each

Licence
MIT
Version
1.1.0
Deps
0
Vulns
0
Weekly
0

seebigs-each

Safely iterate over each item in an Object or Array

Install

$ npm install seebigs-each

Use

var each = require('seebigs-each');

each(collection, function (value, key, collection) {
    if (value.indexOf('foo') !== -1) {
        console.log(value);
        return false; // return false to drop out of loop early
    }
});