PWA
CI / build (push) Has been skipped
CI / deploy (push) Successful in 1m31s

This commit is contained in:
eewing
2026-02-18 11:45:07 -06:00
parent 6167c760a1
commit f6d0c065a4
11032 changed files with 875000 additions and 134771 deletions
+15
View File
@@ -0,0 +1,15 @@
var baseRandom = require('./_baseRandom');
/**
* A specialized version of `_.sample` for arrays.
*
* @private
* @param {Array} array The array to sample.
* @returns {*} Returns the random element.
*/
function arraySample(array) {
var length = array.length;
return length ? array[baseRandom(0, length - 1)] : undefined;
}
module.exports = arraySample;