• Determines whether all elements of a sequence satisfy a condition.

    See

    all for fluent syntax.

    Example

    const numbers = [1, 2, 3, 4];
    const areAllNumbersEven = all(numbers, x => x % 2 === 0);

    Returns

    true if every element of the source sequence passes the test in the specified predicate, or if the sequence is empty; otherwise, false.

    Type Parameters

    • TSource

    Parameters

    • src: Iterable<TSource>

      An Enumerable that contains the elements to apply the predicate to.

    • condition: ((item: TSource, index: number) => boolean)

      A function to test each element for a condition.

        • (item: TSource, index: number): boolean
        • Parameters

          • item: TSource
          • index: number

          Returns boolean

    Returns boolean

Generated using TypeDoc