yta
    Preparing search index...

    Function some

    • Consumes the iterator into true if predicate holds true for one of more of the items in the sequence.

      import { pipe } from "yta";
      import { of, some } from "yta/sync";

      pipe(
      of(1, 3, 5),
      some((n) => n % 2 === 0),
      );
      // => false

      pipe(
      of("foo", "bar", "baz"),
      some((str) => str.startsWith("b")),
      );
      // => true

      pipe(
      of(),
      some(() => true),
      );
      // => false

      See also:

      Type Parameters

      • A

      Parameters

      • p: (item: A) => boolean

        The predicate function

      Returns (items: Iterable<A>) => boolean