JSPM

map-times

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q32391F
  • License MIT

Iterate through a count collecting results for each index

Package Exports

  • map-times

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 (map-times) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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