A bounded array that automatically maintains a maximum size by removing the oldest entries when new items are added beyond the limit.

Extends the native Array class to provide all standard array methods while enforcing a fixed maximum size of MAX_ARRAY_SIZE (1000 entries).

When the size limit is exceeded, the oldest entries (at the beginning of the array) are automatically removed to make room for new ones.

const commands = new BArray()
commands.push(entry) // Automatically removes oldest if over 1000

Type Parameters

  • T

Hierarchy

  • Array<T>
    • BArray

Indexable

  • [n: number]: T

Constructors

Methods

Constructors

  • Type Parameters

    • T

    Parameters

    • arrayLength: number

    Returns BArray<T>

  • Type Parameters

    • T

    Parameters

    • ...items: T[]

    Returns BArray<T>

Methods