From b5d5bef6787f44a9ed4bb4126b247ca7c234f1f0 Mon Sep 17 00:00:00 2001 From: jdalton Date: Thu, 7 May 2015 00:38:22 -0700 Subject: [PATCH] Avoid undefined `length` variable use in `createExtremum`. --- lodash.src.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lodash.src.js b/lodash.src.js index 2d39b359f..5799da8ef 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -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; } }