function findLastIndex(array, predicate) {
  const index = array.slice().reverse().findIndex(predicate);
  if (index === -1) {
    return index;
  }
  return array.length - index - 1;
}
@template T
@param {T[]} array
@param {(item: T) => boolean} predicate