Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tag: 0.2.1
Fetching contributors…

Cannot retrieve contributors at this time

61 lines (35 sloc) 0.662 kb

each

Array / object / string iteration utility.

Installation

$ component install component/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

Jump to Line
Something went wrong with that request. Please try again.