Skip to content

Commit c541e4c

Browse files
gu-xionghongjdalton
authored andcommitted
Fix _.maxBy and _.minBy (#4233)
1 parent e7221b9 commit c541e4c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

maxBy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ function maxBy(array, iteratee) {
2222
if (array == null) {
2323
return result
2424
}
25+
let computed
2526
for (const value of array) {
26-
let computed
2727
const current = iteratee(value)
2828

2929
if (current != null && (computed === undefined

minBy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ function minBy(array, iteratee) {
2222
if (array == null) {
2323
return result
2424
}
25+
let computed
2526
for (const value of array) {
26-
let computed
2727
const current = iteratee(value)
2828

2929
if (current != null && (computed === undefined

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy