Sha256: 766483dbae2e6bc4ea467ee729ac5d0919fd0b6afc64cf19dcf046129bc604a4

Contents?: true

Size: 1.41 KB

Versions: 32

Compression:

Stored size: 1.41 KB

Contents

# repeat-element [![NPM version](https://badge.fury.io/js/repeat-element.svg)](http://badge.fury.io/js/repeat-element)

> Create an array by repeating the given value n times.

## Install

Install with [npm](https://www.npmjs.com/)

```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](https://github.com/jonschlinkert/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](https://github.com/jonschlinkert/repeat-element/issues)

## Author

**Jon Schlinkert**

+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

## License

Copyright (c) 2015 Jon Schlinkert
Released under the MIT license.

***

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on May 06, 2015._

Version data entries

32 entries across 32 versions & 13 rubygems

Version Path
blsk-sevcore-0.0.2 blsk_old/bluesky-doc/bluesky-doc/node_modules/repeat-element/README.md
optimacms-0.4.3 spec/dummy/node_modules/repeat-element/README.md
optimacms-0.4.2 spec/dummy/node_modules/repeat-element/README.md
locomotivecms-3.4.0 app/javascript/node_modules/repeat-element/README.md
cortex-0.1.3 spec/dummy/node_modules/repeat-element/README.md
condenser-0.0.4 lib/condenser/processors/node_modules/repeat-element/README.md
dragonfly_puppeteer-0.1.0 node_modules/repeat-element/README.md
affiliator-0.2.1 node_modules/repeat-element/README.md
lanes-0.8.0 node_modules/repeat-element/README.md
brwy_rails-0.0.6 test/dummy/node_modules/repeat-element/README.md
brwy_rails-0.0.5 test/dummy/node_modules/repeat-element/README.md
blackboard-3.1.9 lib/site_template/node_modules/repeat-element/README.md
brwy_rails-0.0.4 test/dummy/node_modules/repeat-element/README.md
brwy_rails-0.0.3 test/dummy/node_modules/repeat-element/README.md
brwy_rails-0.0.2 test/dummy/node_modules/repeat-element/README.md
brwy_rails-0.0.1 test/dummy/node_modules/repeat-element/README.md
es6_tilt-0.1.2 test/dummy/app/assets/javascripts/node_modules/repeat-element/README.md
es6_tilt-0.1.1 test/dummy/app/assets/javascripts/node_modules/repeat-element/README.md
es6_tilt-0.1.0 test/dummy/app/assets/javascripts/node_modules/repeat-element/README.md
hooch-0.4.2 jasmine/node_modules/karma/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/node_modules/braces/node_modules/repeat-element/README.md