1.0.1 ⢠Published 6 years ago
random-n v1.0.1
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