1.0.2 • Published 8 years ago

map-times v1.0.2

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

map-times Build Status

Iterate through a count collecting results for each index

Install

$ npm install --save map-times

Usage

var times = require('map-times')

times(3, function (index) {
  return index * 2  
})
//=> [0, 2, 4]

API

times(count, callback) -> array

count

Required
Type: number

The number of times to call the callback.

callback

Required
Type: function
Arguments: index

A function that will be called the specified number of times with the index of the call.

License

MIT © Ben Drucker