Function at

  • Retrieves the element at a given index from an input iterable.

    Returns

    A function that accepts an input iterable and returns the element at the specified index.

    Example

    const input = [1, 2, 3];
    const elementAtIndex2 = at<number>(2)(input);
    console.log(elementAtIndex2); // Logs 3

    Type Parameters

    • T

      The type of elements in the input iterable.

    Parameters

    • i: number

      The index of the element to retrieve.

    Returns ((input: AnyIterable<T>) => Promise<undefined | T>)

      • (input: AnyIterable<T>): Promise<undefined | T>
      • Parameters

        Returns Promise<undefined | T>

Generated using TypeDoc