blob: 58582b9112730b224788c1a7c79e939b636bb107 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
var arraySample = require('./_arraySample'),
values = require('./values');
/**
* The base implementation of `_.sample`.
*
* @private
* @param {Array|Object} collection The collection to sample.
* @returns {*} Returns the random element.
*/
function baseSample(collection) {
return arraySample(values(collection));
}
module.exports = baseSample;
|