bredele-each

0.1.2 • Public • Published

each

Iteration utility.

Installation

with component:

$ component install bredele/each

with nodejs:

$ npm install bredele-each

API

You'll find lots of iteration components out there (like component-each). However, each exposes a consistent API for both arrays and objects (the first argument is the object's key - or index for an array -).

each(array, fn, [scope])

Iterate an array:

each(['olivier', 'bredele'], function(key, val){
  //key is the array's index
})

each(object, fn, [scope])

Iterate an object;

each(conf, function(key, val){
  //key is the object's key
})

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i bredele-each

Weekly Downloads

1

Version

0.1.2

License

BSD

Last publish

Collaborators

  • bredele