@nbogie/p5.neill-utils
    Preparing search index...

    Function maxBy

    • Finds the element in an array that results in the maximum value when passed through the iteratee function. *

      Type Parameters

      • T
      • V

      Parameters

      • array: T[]

        The array to iterate over.

      • iteratee: (value: T) => V

        The function to execute on each element to get the value to compare.

      Returns T | undefined

      The element that produced the maximum value, or undefined if the array is empty.