mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 16:47:49 +00:00
Bump to v4.16.2.
This commit is contained in:
15
_baseSample.js
Normal file
15
_baseSample.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import arraySample from './_arraySample.js';
|
||||
import values from './values.js';
|
||||
|
||||
/**
|
||||
* 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));
|
||||
}
|
||||
|
||||
export default baseSample;
|
||||
Reference in New Issue
Block a user