Bump to v3.9.0.

This commit is contained in:
jdalton
2015-05-07 01:47:27 -07:00
parent 53c14e5b9b
commit f84f83a4a5
88 changed files with 1022 additions and 1098 deletions

30
internal/arrayExtremum.js Normal file
View File

@@ -0,0 +1,30 @@
/**
* A specialized version of `baseExtremum` for arrays whichs invokes `iteratee`
* with one argument: (value).
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {Function} comparator The function used to compare values.
* @param {*} exValue The initial extremum value.
* @returns {*} Returns the extremum value.
*/
function arrayExtremum(array, iteratee, comparator, exValue) {
var index = -1,
length = array.length,
computed = exValue,
result = computed;
while (++index < length) {
var value = array[index],
current = +iteratee(value);
if (comparator(current, computed)) {
computed = current;
result = value;
}
}
return result;
}
module.exports = arrayExtremum;