@f/times

1.0.0 • Public • Published

times

Build status Git tag NPM version Code style

Run a function n times and aggregate the results into an array

Installation

$ npm install @f/times

Usage

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

times(3, identity) === [0, 1, 2]

API

times(n, fn)

  • n - The number of times to run fn(i)
  • fn - Receives a single argument, the current index. Also called with the same this context as times.

Returns: An array of the return values of fn.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @f/times

Weekly Downloads

3

Version

1.0.0

License

MIT

Last publish

Collaborators

  • f