• Parameters

    • array: any[]

      an array of any comparable type

    • Optional map: Function

      an optional map function to run on all elements

    Returns number

    an index from the input array, or undefined if the array has no length.

    Description

    Return the index of the largest value in the array. An optional map function parameter can be provided to map the values into another state before searching for the maximum value.