1 var baseClamp = require('./_baseClamp'),
2 copyArray = require('./_copyArray'),
3 shuffleSelf = require('./_shuffleSelf');
6 * A specialized version of `_.sampleSize` for arrays.
9 * @param {Array} array The array to sample.
10 * @param {number} n The number of elements to sample.
11 * @returns {Array} Returns the random elements.
13 function arraySampleSize(array, n) {
14 return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
17 module.exports = arraySampleSize;