yta
    Preparing search index...

    Function at

    • Get the item at the given index, or undefined if the sequence is empty. Negative values count backwards from the end.

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

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

      pipe(of("foo", "bar", "baz", "quux"), at(-1));
      // => "quux"

      See also:

      Type Parameters

      • A

      Parameters

      • index: number

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