yta
    Preparing search index...

    Function first

    • Get the first element of the sequence or undefined if sequence is empty.

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

      pipe(of("foo", "bar", "baz", "quux"), first());
      // => "foo"

      See also:

      Type Parameters

      • A

      Returns (items: Iterable<A>) => A | undefined