random-n
v1.0.1
Published
🚀 The blazing fast module to get a random collection of n different items from an array
Downloads
26
Maintainers
Readme
random-n
🚀 The blazing fast module to get a random collection of n different items from an array.
Install
$ npm i random-n
Usage
import random from 'random-n'
random([1, 2, 3, 4, 5], 3)
// [3, 2, 5]
random(array, size?)
- array
Array
- size
?int=array.length
The n-size of the collection. If not specified, the length of thearray
will be used.
Returns Array
License
MIT