b5e696abe589b6213e1befdccf330a46cd382e90a63bbf5d8c45dbc7203dde9c0393993e68465c42d51a2987ad35d0cc2349202a305c89c1d6fa24c8501164 357 B

123456789101112131415
  1. import arraySample from './_arraySample.js';
  2. import values from './values.js';
  3. /**
  4. * The base implementation of `_.sample`.
  5. *
  6. * @private
  7. * @param {Array|Object} collection The collection to sample.
  8. * @returns {*} Returns the random element.
  9. */
  10. function baseSample(collection) {
  11. return arraySample(values(collection));
  12. }
  13. export default baseSample;