Function some

  • Evaluates items in an iterable or asynchronous iterable against a predicate and returns true if any item evaluates to true.

    Example

    const someEven = some((number: number) => number % 2 === 0);
    someEven([1, 2, 3, 4]); // true
    someEven([1, 3, 5, 7]); // false

    Returns

    Curried function with predicate set in context.

    Type Parameters

    • Item

    • Predicated = Item

    Parameters

    • predicate: Predicate<Item, Predicated>

      Predicate function to evaluate each item.

    Returns (<Iterable>(iterable: Iterable) => ReducerOutput<Iterable, boolean>)

      • <Iterable>(iterable: Iterable): ReducerOutput<Iterable, boolean>
      • Type Parameters

        • Iterable extends AsynchronousIterable<Item>

        Parameters

        • iterable: Iterable

        Returns ReducerOutput<Iterable, boolean>