component-each

0.2.6 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.6
    165,703
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.6
    165,703
  • 0.2.5
    198
  • 0.2.4
    2
  • 0.2.2
    4
  • 1.0.0
    1,494
  • 0.2.1
    2
  • 0.2.0
    2

Package Sidebar

Install

npm i component-each

Weekly Downloads

53,058

Version

0.2.6

License

none

Last publish

Collaborators

  • defunctzombie
  • dfcreative
  • tootallnate
  • tjholowaychuk
  • rauchg
  • retrofox
  • coreh
  • forbeslindesay
  • kelonye
  • mattmueller
  • yields
  • anthonyshort
  • jongleberry
  • ianstormtaylor
  • cristiandouce
  • swatinem
  • stagas
  • amasad
  • juliangruber
  • calvinfo
  • dominicbarnes
  • timoxley
  • jonathanong
  • queckezz
  • nami-doc
  • clintwood
  • thehydroimpulse
  • stephenmathieson
  • trevorgerhardt
  • timaschew
  • hughsk