repeat

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
952 B
Returns a fixed list of size `n` containing a specified identical value.
1 contributor
Install repeat as a package?
Copied
npm i @bit/justin-capalbo.ramda.repeat
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
repeat (
value:*,
n:Number
) : Array

Returns a fixed list of size n containing a specified identical value.

Example
R.repeat('hi', 5); //=> ['hi', 'hi', 'hi', 'hi', 'hi']

     const obj = {};
     const repeatedObjs = R.repeat(obj, 5); //=> [{}, {}, {}, {}, {}]
     repeatedObjs[0] === repeatedObjs[1]; //=> true
Arguments
value: *

The value to repeat.

n: Number

The desired size of the output list.

Returns
Array

A new array containing `n` `value`s.

Help and resources