times

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
3
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
893 B
Calls an input function `n` times, returning an array containing the results of those function calls.
1 contributor
Install times as a package?
Copied
npm i @bit/justin-capalbo.ramda.times
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
times (
fn:Function,
n:Number
) : Array

Calls an input function n times, returning an array containing the results of those function calls.

fn is passed one argument: The current value of n, which begins at 0 and is gradually incremented to n - 1.

Example
R.times(R.identity, 5); //=> [0, 1, 2, 3, 4]
Arguments
fn: Function

The function to invoke. Passed one argument, the current value of n.

n: Number

A value between 0 and n - 1. Increments after each function call.

Returns
Array

An array containing the return values of all calls to `fn`.

Help and resources