Move arraySample definition to fix builds.

This commit is contained in:
John-David Dalton
2016-09-06 14:24:53 -07:00
parent 5add168743
commit 8176d56c72

View File

@@ -712,19 +712,6 @@
return accumulator;
}
/**
* A specialized version of `_.sample` for arrays without support for iteratee
* shorthands.
*
* @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;
}
/**
* A specialized version of `_.some` for arrays without support for iteratee
* shorthands.
@@ -2392,6 +2379,19 @@
return result;
}
/**
* A specialized version of `_.sample` for arrays without support for iteratee
* shorthands.
*
* @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;
}
/**
* Used by `_.defaults` to customize its `_.assignIn` use.
*