component-each
Array / object / string iteration utility
Last updated 5 years ago by timaschew .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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 (5 years ago)

7 Versions

  • 0.2.6                                ...           5 years ago
  • 0.2.5                                ...           6 years ago
  • 0.2.4                                ...           7 years ago
  • 0.2.2                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
  • 0.2.1                                ...           7 years ago
  • 0.2.0                                ...           7 years ago

Copyright 2014 - 2016 © taobao.org |