Files
lodash/_arraySampleSize.js
John-David Dalton 2f8450b523 Bump to v4.16.2.
2016-09-25 13:37:46 -07:00

17 lines
441 B
JavaScript

define(['./_copyArray', './_shuffleSelf'], function(copyArray, shuffleSelf) {
/**
* A specialized version of `_.sampleSize` for arrays.
*
* @private
* @param {Array} array The array to sample.
* @param {number} n The number of elements to sample.
* @returns {Array} Returns the random elements.
*/
function arraySampleSize(array, n) {
return shuffleSelf(copyArray(array), n);
}
return arraySampleSize;
});