mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +00:00
Apply even more let/const transforms.
This commit is contained in:
@@ -3,7 +3,7 @@ import baseIteratee from './_baseIteratee.js';
|
||||
import toInteger from './toInteger.js';
|
||||
|
||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||
var nativeMax = Math.max;
|
||||
const nativeMax = Math.max;
|
||||
|
||||
/**
|
||||
* This method is like `_.find` except that it returns the index of the first
|
||||
@@ -41,11 +41,11 @@ var nativeMax = Math.max;
|
||||
* // => 2
|
||||
*/
|
||||
function findIndex(array, predicate, fromIndex) {
|
||||
var length = array == null ? 0 : array.length;
|
||||
const length = array == null ? 0 : array.length;
|
||||
if (!length) {
|
||||
return -1;
|
||||
}
|
||||
var index = fromIndex == null ? 0 : toInteger(fromIndex);
|
||||
let index = fromIndex == null ? 0 : toInteger(fromIndex);
|
||||
if (index < 0) {
|
||||
index = nativeMax(length + index, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user