ktongue's picture
download
raw
582 Bytes
export default function maxIndex(values, valueof) {
let max;
let maxIndex = -1;
let index = -1;
if (valueof === undefined) {
for (const value of values) {
++index;
if (value != null
&& (max < value || (max === undefined && value >= value))) {
max = value, maxIndex = index;
}
}
} else {
for (let value of values) {
if ((value = valueof(value, ++index, values)) != null
&& (max < value || (max === undefined && value >= value))) {
max = value, maxIndex = index;
}
}
}
return maxIndex;
}

Xet Storage Details

Size:
582 Bytes
·
Xet hash:
6103d5b6d280aa66fa58b99b0ce85f68bc31cef6d0183260eeef1f1785aeb181

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.