@jiminp/tooltool
    Preparing search index...

    Function arrayGetOrExtend

    • Gets the element at the given index, extending with shallow copies if out of bounds.

      Type Parameters

      • T extends object

        Element type.

      Parameters

      • arr: T[]

        The array.

      • index: number

        Non-negative index.

      • default_value: T

        Template for new entries (shallow-copied).

      Returns T

      The element at index.

      If index is negative.