* A specialized version of `_.sample` for arrays. * * @private * @param {Array} array The array to sample. * @returns {*} Returns the random element.
(array)
| 8 | * @returns {*} Returns the random element. |
| 9 | */ |
| 10 | function arraySample(array) { |
| 11 | var length = array.length; |
| 12 | return length ? array[baseRandom(0, length - 1)] : undefined; |
| 13 | } |
| 14 | |
| 15 | module.exports = arraySample; |
nothing calls this directly
no test coverage detected