maxBy(items, keyFn) {
    let maxItem = undefined;
    let maxValue = -Infinity;
    for (const item of items) {
      const value = keyFn(item);
      if (value > maxValue) {
        maxItem = item;
        maxValue = value;
      }
    }

    return maxItem;
  }
@template TArr
@param {Array<TArr>} items
@param {(o: TArr) => number} keyFn