• Returns true if the provided predicate function returns true for at least one element in a collection, false otherwise

    Example

    any([0, 1, 2, 0], (x) => x >= 2); // true
    

    Example

    any([0, 0, 1, 0]); // true
    

    Type Parameters

    • T

    Parameters

    • array: T[]
    • Optional fn: ((value: T, index: number, array: T[]) => boolean) = Boolean
        • (value: T, index: number, array: T[]): boolean
        • Parameters

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

          Returns boolean

    Returns boolean

Generated using TypeDoc