component-each
Array / object / string iteration utility
Last updated 9 years ago by timaschew .
Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install component-each 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.2.6                                ...           latest (9 years ago)

7 Versions

  • 0.2.6                                ...           9 years ago
  • 0.2.5                                ...           10 years ago
  • 0.2.4                                ...           11 years ago
  • 0.2.2                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
  • 0.2.1                                ...           11 years ago
  • 0.2.0                                ...           11 years ago

Copyright 2013 - present © cnpmjs.org | Home |