Sha256: fddbed1714457a56bf4da3fddfeccbde039cae8cc06621b82ce2518b38625cee
Contents?: true
Size: 548 Bytes
Versions: 264
Compression:
Stored size: 548 Bytes
Contents
var baseClamp = require('./_baseClamp'), shuffleSelf = require('./_shuffleSelf'), values = require('./values'); /** * The base implementation of `_.sampleSize` without param guards. * * @private * @param {Array|Object} collection The collection to sample. * @param {number} n The number of elements to sample. * @returns {Array} Returns the random elements. */ function baseSampleSize(collection, n) { var array = values(collection); return shuffleSelf(array, baseClamp(n, 0, array.length)); } module.exports = baseSampleSize;
Version data entries
264 entries across 262 versions & 29 rubygems