From c541e4ccdc22413eed96572acdce3b0b5fe0cb61 Mon Sep 17 00:00:00 2001 From: Amu <514720858@qq.com> Date: Tue, 12 Mar 2019 12:43:45 +0800 Subject: [PATCH] Fix _.maxBy and _.minBy (#4233) --- maxBy.js | 2 +- minBy.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/maxBy.js b/maxBy.js index 9d346ebfa..5cfa987f6 100644 --- a/maxBy.js +++ b/maxBy.js @@ -22,8 +22,8 @@ function maxBy(array, iteratee) { if (array == null) { return result } + let computed for (const value of array) { - let computed const current = iteratee(value) if (current != null && (computed === undefined diff --git a/minBy.js b/minBy.js index 8f5879aeb..327428faa 100644 --- a/minBy.js +++ b/minBy.js @@ -22,8 +22,8 @@ function minBy(array, iteratee) { if (array == null) { return result } + let computed for (const value of array) { - let computed const current = iteratee(value) if (current != null && (computed === undefined