random-pick
Pick random unique items from an array.
Install
$ npm install --save random-pick
Usage
const pick = const fruits = 'apple' 'banana' 'peach' 'mango' //=> ['banana'] //=> ['apple', 'peach'] //=> ['e', 'h', 'r', 'w'] //=> ['<div class="item">...</div>', '<div class="item">...</div>']
API
randomPick(input[, count])
input
Type: array
string
object
The array or string or array-like object to pick from.
count
Type: number
Default: 1
The amount of items you wanna pick.
return
Type: array
Return the picked items.
License
MIT © EGOIST