Function find

  • Find the first element of an array that satisfies the callback.

    Returns

    the first element satisfying the callback, or null

    Type Parameters

    • T

    Parameters

    • array: T[]

      the input array

    • callback: ((value: T, index: number, array: T[]) => boolean)

      the callback functioning as a search query

        • (value: T, index: number, array: T[]): boolean
        • Parameters

          • value: T
          • index: number
          • array: T[]

          Returns boolean

    Returns T | null

Generated using TypeDoc