Eachr
![Dev Dependency Status](https://img.shields.io/david/dev/bevry/eachr.svg)
![Wishlist browse button](https://img.shields.io/badge/wishlist-donate-yellow.svg)
Give eachr an array or object, and the iterator, in return eachr will give the iterator the value and key of each item, and will stop if the iterator returned false.
Install
- Use:
require('eachr')
- Install:
npm install --save eachr
- Use:
require('eachr')
- Install:
npm install --save eachr
- CDN URL:
//wzrd.in/bundle/eachr@2.0.4
- Use:
require('eachr')
- Install:
ender add eachr
Usage
var each = require("eachr");
var arr = ["first", "second", "third"];
var obj = {a:"first", b:"second", c:"third"};
var iterator = function(value,key){
console.log({value:value, key:key});
if ( value === "second" ) {
console.log("break");
return false;
}
};
each(arr, iterator);
each(obj, iterator);
History
Discover the change history by heading on over to the HISTORY.md
file.
Contribute
Discover how you can contribute by heading on over to the CONTRIBUTING.md
file.
Backers
Maintainers
These amazing people are maintaining this project:
No sponsors yet! Will you be the first?
![Wishlist browse button](https://img.shields.io/badge/wishlist-donate-yellow.svg)
Contributors
These amazing people have contributed code to this project:
Become a contributor!
License
Unless stated otherwise all works are:
and licensed under: