yta
    Preparing search index...

    Function last

    • Get the last item of a sequence, or undefined if the sequence is empty.

      import { pipe } from "yta";
      import { of, last } from "yta/async";

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

      See also:

      Type Parameters

      • A

      Returns (items: AsyncIterable<A>) => Promise<A | undefined>