``` function maxDate(currentMax, currentValue, i, ...
# suitescript
e
Copy code
function maxDate(currentMax, currentValue, i, list) {
  return (currentValue.date.getTime() > list[currentMax].date.getTime()) ? i : currentMax;
}

var listOfDates = /* your data */;
var maxDateIndex = listOfDates.reduce(maxDate);