1.2.2 • Published 8 years ago

@f/foreach v1.2.2

Weekly downloads
628
License
MIT
Repository
github
Last release
8 years ago

foreach

Build status Git tag NPM version Code style

Fast for each.

Installation

$ npm install @f/foreach

Usage

var foreach = require('@f/foreach')

var obj = {a: 1, b: 2}
var copy = {}

foreach(function (val, key) {
  copy[key] = val
})

copy // => {a: 1, b: 2}

API

foreach(fn, obj)

  • fn - iterator
  • obj - object to iterate over

License

MIT