shrine-medco/shrine-webclient/src/main/html/node_modules/repeat-elementc27d08be9edftokyber
shrine-medco/shrine-webclient/src/main/html/node_modules/repeat-element
c27d08be9edftokyber
repeat-element
repeat-element
README.md
README.md
repeat-element ![NPM version](http://badge.fury.io/js/repeat-element)
Create an array by repeating the given value n times.
Install
Install with npm
bash npm i repeat-element --save
Usage
js var repeat = require('repeat-element'); repeat('a', 5); //=> ['a', 'a', 'a', 'a', 'a'] repeat('a', 1); //=> ['a'] repeat('a', 0); //=> [] repeat(null, 5) //» [ null, null, null, null, null ] repeat({some: 'object'}, 5) //» [ { some: 'object' }, // { some: 'object' }, // { some: 'object' }, // { some: 'object' }, // { some: 'object' } ] repeat(5, 5) //» [ 5, 5, 5, 5, 5 ]
Related projects
repeat-string: Repeat the given string n times. Fastest implementation for repeating a string.
Running tests
Install dev dependencies:
bash npm i -d && npm test
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Author
Jon Schlinkert
+ github/jonschlinkert + twitter/jonschlinkert
License
Copyright (c) 2015 Jon Schlinkert Released under the MIT license.
_This file was generated by verb-cli on May 06, 2015._
c4science · Help