Bachir Soussi Chiadmi ac58a24f5c added bower, gulp | 7 سال پیش | |
---|---|---|
.. | ||
LICENSE | 7 سال پیش | |
README.md | 7 سال پیش | |
index.js | 7 سال پیش | |
package.json | 7 سال پیش |
Create an array by repeating the given value n times.
Install with npm
npm i repeat-element --save
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 ]
repeat-string: Repeat the given string n times. Fastest implementation for repeating a string.
Install dev dependencies:
npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright (c) 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on May 06, 2015.