mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Use more for-of
This commit is contained in:
9
maxBy.js
9
maxBy.js
@@ -19,12 +19,11 @@ import isSymbol from './isSymbol.js'
|
||||
*/
|
||||
function maxBy(array, iteratee) {
|
||||
let result
|
||||
let index = -1
|
||||
const length = array == null ? 0 : array.length
|
||||
|
||||
while (++index < length) {
|
||||
if (array == null) {
|
||||
return result
|
||||
}
|
||||
for (const value of array) {
|
||||
let computed
|
||||
const value = array[index]
|
||||
const current = iteratee(value)
|
||||
|
||||
if (current != null && (computed === undefined
|
||||
|
||||
Reference in New Issue
Block a user