* Gets `n` random elements at unique keys from `collection` up to the * size of `collection`. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @param
(collection, n, guard)
| 20416 | * // => [2, 3, 1] |
| 20417 | */ |
| 20418 | function sampleSize(collection, n, guard) { |
| 20419 | if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { |
| 20420 | n = 1; |
| 20421 | } else { |
| 20422 | n = toInteger(n); |
| 20423 | } |
| 20424 | var func = isArray(collection) ? arraySampleSize : baseSampleSize; |
| 20425 | return func(collection, n); |
| 20426 | } |
| 20427 | |
| 20428 | /** |
| 20429 | * Creates an array of shuffled values, using a version of the |
nothing calls this directly
no test coverage detected