Files
lodash/.internal/baseSample.js
2017-01-10 00:45:05 -08:00

16 lines
364 B
JavaScript

import arraySample from './.internal/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;