Modularize master branch.

This commit is contained in:
John-David Dalton
2016-12-30 22:26:46 -06:00
parent 912d6b04a1
commit 2900cfd288
745 changed files with 19699 additions and 140151 deletions

15
_arraySample.js Normal file
View File

@@ -0,0 +1,15 @@
import baseRandom from './_baseRandom.js';
/**
* 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;
}
export default arraySample;