@jiminp/tooltool
    Preparing search index...

    Function arrayGetOrExtendWith

    • Gets the element at the given index, extending via a factory function if out of bounds.

      Type Parameters

      • T extends object

        Element type.

      Parameters

      • arr: T[]

        The array.

      • index: number

        Non-negative index.

      • f: (index: number) => T

        Factory called with index to create new entries.

      Returns T

      The element at index.

      If index is negative.