Skip to main content

some

Callable

  • some<T>(xs: Traversable<T, unknown>, predicate: (x: T) => boolean): boolean

  • The function tests whether any elements in the Traversable satisfy the predicate.

    Example

    any([true, true, true], identity)
    // => true

    any([10, 11, 5], x => x > 10)
    // => true

    any([true, false, true], identity)
    // => true

    any(false, false, false], identity)
    // => false

    all([], identity)
    // => true

    Alternatives

    Proposals

    @see

    Type parameters

    • T

      The element type.

    Parameters

    • xs: Traversable<T, unknown>

      The values to check.

    • predicate: (x: T) => boolean

      The predicate that will be checked on every element.

    Returns boolean

    Whether any element satisfies the predicate.