Collection
Samplesize

_.sampleSize(collection, [n=1])

Gets n random elements at unique keys from collection up to the size of collection.

Arguments

collection (Array|Object): The collection to sample.
[n=1] (number): The number of elements to sample.

Returns

(Array): Returns the random element.

Example

Deep