mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 03:47:50 +00:00
Apply even more let/const transforms.
This commit is contained in:
10
_reorder.js
10
_reorder.js
@@ -2,7 +2,7 @@ import copyArray from './_copyArray.js';
|
||||
import isIndex from './_isIndex.js';
|
||||
|
||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||
var nativeMin = Math.min;
|
||||
const nativeMin = Math.min;
|
||||
|
||||
/**
|
||||
* Reorder `array` according to the specified indexes where the element at
|
||||
@@ -15,12 +15,12 @@ var nativeMin = Math.min;
|
||||
* @returns {Array} Returns `array`.
|
||||
*/
|
||||
function reorder(array, indexes) {
|
||||
var arrLength = array.length,
|
||||
length = nativeMin(indexes.length, arrLength),
|
||||
oldArray = copyArray(array);
|
||||
const arrLength = array.length;
|
||||
let length = nativeMin(indexes.length, arrLength);
|
||||
const oldArray = copyArray(array);
|
||||
|
||||
while (length--) {
|
||||
var index = indexes[length];
|
||||
const index = indexes[length];
|
||||
array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
|
||||
}
|
||||
return array;
|
||||
|
||||
Reference in New Issue
Block a user