JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 14098
  • Score
    100M100P100Q129736F

Array / object / string iteration utility

Package Exports

  • component-each

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (component-each) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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