Avoid undefined length variable use in createExtremum.

This commit is contained in:
jdalton
2015-05-07 00:38:22 -07:00
parent 421df0dff3
commit b5d5bef678

View File

@@ -3470,8 +3470,9 @@
: callback(iteratee, thisArg, 3);
if (noIteratee || (isArr && iteratee.length == 1)) {
var result = arrayExtremum(isArr ? collection : toIterable(collection), iteratee, comparator, exValue);
if (noIteratee || !(length && result === exValue)) {
collection = isArr ? collection : toIterable(collection);
var result = arrayExtremum(collection, iteratee, comparator, exValue);
if (noIteratee || !(collection.length && result === exValue)) {
return result;
}
}