Acme.BookStore.HttpApi.Host/node_modules/repeat-element/README.md

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

# 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**

后面还有 11 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。