sample

Collection
since 2.0.0

Arguments

  • Array|Object The collection to sample.

Returns

* the random element.

Gets a random element from collection.

Example of Lodash _.sample

_.sample([1, 2, 3, 4]);
// => 2