JSPM

eachr

2.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 144591
  • Score
    100M100P100Q183576F
  • License

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.

Package Exports

  • eachr

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eachr) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Eachr

Build Status NPM version NPM downloads Dependency Status Dev Dependency Status
Gratipay donate button Flattr donate button PayPayl donate button BitCoin donate button Wishlist browse button

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

NPM

  • Use: require('eachr')
  • Install: npm install --save eachr

Browserify

  • Use: require('eachr')
  • Install: npm install --save eachr
  • CDN URL: //wzrd.in/bundle/eachr@2.0.4

Ender

  • Use: require('eachr')
  • Install: ender add eachr

Usage

// Prepare
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;
    }
};

// Cycle Array
each(arr, iterator);
// {"value":"first",  "key":0}
// {"value":"second", "key":1}
// break

// Cycle Object
each(obj, iterator);
// {"value":"first",  "key":"a"}
// {"value":"second", "key":"b"}
// break

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:

Sponsors

No sponsors yet! Will you be the first?

Gratipay donate button Flattr donate button PayPayl donate button BitCoin donate button Wishlist browse button

Contributors

These amazing people have contributed code to this project:

Become a contributor!

License

Unless stated otherwise all works are:

and licensed under: