compat-each

1.0.0 • Public • Published

compat-each

Array / object / string iteration utility.

component-each forked for complete Duo and Browserify compatibility.

Installation

$ npm install compat-each

API

each(array, fn[, ctx])

Iterate an array:

each([1,2,3], function(num, i){
 
})

Optionally pass a context object:

each([1,2,3], function(num, i){
 
}, this)

each(object, fn[, ctx])

Iterate an object's key / value pairs:

each(conf, function(key, val){
 
})

Iterate an array-ish object (has numeric .length):

each(collection, function(val, i){
 
})

each(string, fn[, ctx])

Iterate a string's characters:

each('hello', function(c, i){
 
})

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i compat-each

Weekly Downloads

1

Version

1.0.0

License

none

Last publish

Collaborators

  • kvnneff