mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 11:27:50 +00:00
Fix _.maxBy and _.minBy (#4233)
This commit is contained in:
2
maxBy.js
2
maxBy.js
@@ -22,8 +22,8 @@ function maxBy(array, iteratee) {
|
|||||||
if (array == null) {
|
if (array == null) {
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
let computed
|
||||||
for (const value of array) {
|
for (const value of array) {
|
||||||
let computed
|
|
||||||
const current = iteratee(value)
|
const current = iteratee(value)
|
||||||
|
|
||||||
if (current != null && (computed === undefined
|
if (current != null && (computed === undefined
|
||||||
|
|||||||
2
minBy.js
2
minBy.js
@@ -22,8 +22,8 @@ function minBy(array, iteratee) {
|
|||||||
if (array == null) {
|
if (array == null) {
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
let computed
|
||||||
for (const value of array) {
|
for (const value of array) {
|
||||||
let computed
|
|
||||||
const current = iteratee(value)
|
const current = iteratee(value)
|
||||||
|
|
||||||
if (current != null && (computed === undefined
|
if (current != null && (computed === undefined
|
||||||
|
|||||||
Reference in New Issue
Block a user