Function any

  • Returns true when any of the items in iterable are truthy. An optional predicate function can be used to define what truthiness means for this specific collection.

    Returns

    True if any element passes the test or is truthy else false.

    Example

    any([0])
    // false

    any([0, 1, null, undefined])
    // true

    any([1, 4, 5] => (n) => n % 2 === 0)
    // true

    See

    all

    Type Parameters

    • T

    Parameters

    • iterable: Iterable<T>
    • fn: Predicate<T, any> = bool

    Returns boolean

Generated using TypeDoc