Function all

  • Returns true when all 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 all elements pass the test or are truthy else false.

    Example

    all([0])
    // true

    all([1, 2, 3])
    // true

    all([2, 4, 6] => (n) => n > 1)
    // true

    See

    any

    Type Parameters

    • T

    Parameters

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

    Returns boolean

Generated using TypeDoc