Function any

  • Checks if any element in the given iterable satisfies the given condition.

    If the condition is a value, this becomes an includes() function.

    Type Parameters

    • Iter extends AnyIt<unknown>
    • V extends unknown

    Parameters

    • iter: Iter

      The iterable or async iterable to check.

    • condition: V | Matcher<V>

      The condition to satisfy.

    Returns AnyItResult<Iter, boolean>

    Returns true if any element satisfies the condition, otherwise false.

    Example

    // Returns true
    it.all([1, 20], x => x < 10)