random-elements-array
Version:
This is a package that provides a function which takes in a array and a number and outputs a array with the given number of random elements from the array.
13 lines (8 loc) • 306 B
Markdown
## Random Elements Array
- When you need an array with number of random elements from an array, you can use this package.
```js
const getRandomElements = require("random-elements-array");
const array = [1,2,3,4,5,6,7,8,9];
const randomArray = getRandomElements(array, 5);
console.log(randomArray);
```