repeat-function

0.2.1 • Public • Published

Repeat a value a number of times. You can also pass a function.

repeat(limit, value);
> repeat(10, 'hi');
['hi', 'hi', 'hi', 'hi', 'hi', 'hi', 'hi', 'hi', 'hi', 'hi']
 
> repeat(10, Math.random);
[ 0.3722359158564359, 0.2253044811077416, 0.007700880523771048, 0.17186463717371225, 0.4193427243735641, 0.7379662005696446, 0.23550302837975323, 0.9457539631985128, 0.8877920298837125, 0.997513564536348 ]
 

Package Sidebar

Install

npm i repeat-function

Weekly Downloads

1

Version

0.2.1

License

BSD

Last publish

Collaborators

  • jayrbolton
  • the_swerve