Wraps an array exposing the same mutation API (push, pop, unshift, shift, splice) and adds a few extra methods namely: set, move, swap and clear.

Example

import { ArrayList } from 'deleight/lists/array';
const array = [];
const list = new ArrayList(array);
list.push(1, 2, 3);
console.log(array.length); // 3
list.swap(0, 2);
console.log(array); // [3, 2, 1]

Type Parameters

  • T

Constructors

Properties

Accessors

Methods

Constructors

Properties

array: T[]

Accessors

Methods

  • Parameters

    • index: number

    Returns Generator<never, T, unknown>