gen-randint-array-cjs
Version:
A helper function that returns an array filled with random integers.
49 lines (30 loc) • 1.42 kB
Markdown
is a helper function to help you generate an array with a length of your choice and given the min and max range as ±negPos
Compatible with both client-side and server-side environments.
Install the **Gen-RandInt-Array** package with [NPM](https://www.npmjs.org/):
```sh
npm install gen-randint-array-cjs
```
Now when that is done, in your application code, using the `require()` import the `genRandIntArray()` method and assign the return value to a variable:
```js
var genRandIntArray = require('gen-randint-array-cjs');
const array = genRandIntArray(10, 10); // Returns an array of 10 random values ranging from -10 to 10
```
The Gen-RandInt-Array helper function has zero dependencies.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
The Gen-RandInt-Array Project is released under the [Apache License](http://www.apache.org/licenses/).
- [Gen-RandInt-Array (For Server Side)](
- [Contents](
- [Description](
- [Usage](
- [Server-side Only](
- [Requirements](
- [Contributing](
- [License](
Gen-RandInt-Array