Type alias ArrayPredicate<T>

ArrayPredicate<T>: ((value, index, array) => boolean)

Type Parameters

  • T

Type declaration

    • (value, index, array): boolean
    • Type definition for a predicate function that operates on arrays.

      Parameters

      • value: T

        The current element being processed in the array.

      • index: number

        The index of the current element being processed in the array.

      • array: T[]

        The array ArrayPredicate was called upon.

      Returns boolean

      A boolean indicating whether the current element passes the test.

      Remarks

      This type is useful when you want to create a function that can be used with methods like Array.prototype.filter.

      Typeparam

      T - The type of elements in the array.

Generated using TypeDoc