MutableArray
@algorandfoundation/algorand-typescript
@algorandfoundation/algorand-typescript / index / MutableArray
Class: MutableArray<TItem>
Section titled “Class: MutableArray<TItem>”Defined in: packages/algo-ts/src/mutable-array.ts:7
An in memory mutable array which is passed by reference
Type Parameters
Section titled “Type Parameters”• TItem
Indexable
Section titled “Indexable”[index: uint64]: TItem
Constructors
Section titled “Constructors”new MutableArray()
Section titled “new MutableArray()”new MutableArray<
TItem>(…items):MutableArray<TItem>
Defined in: packages/algo-ts/src/mutable-array.ts:12
Create a new MutableArray with the specified items
Parameters
Section titled “Parameters”…TItem[]
The initial items for the array
Returns
Section titled “Returns”MutableArray<TItem>
Accessors
Section titled “Accessors”length
Section titled “length”Get Signature
Section titled “Get Signature”get length():
uint64
Defined in: packages/algo-ts/src/mutable-array.ts:17
Returns the current length of this array
Returns
Section titled “Returns”Methods
Section titled “Methods”[iterator]()
Section titled “[iterator]()”[iterator]():
IterableIterator<TItem>
Defined in: packages/algo-ts/src/mutable-array.ts:57
Returns an iterator for the items in this array
Returns
Section titled “Returns”IterableIterator<TItem>
at(
index):TItem
Defined in: packages/algo-ts/src/mutable-array.ts:26
Returns the item at the given index. Negative indexes are taken from the end.
Parameters
Section titled “Parameters”The index of the item to retrieve
Returns
Section titled “Returns”TItem
copy()
Section titled “copy()”copy():
MutableArray<TItem>
Defined in: packages/algo-ts/src/mutable-array.ts:99
Create a copy of this array
Returns
Section titled “Returns”MutableArray<TItem>
entries()
Section titled “entries()”entries():
IterableIterator<readonly [uint64,TItem]>
Defined in: packages/algo-ts/src/mutable-array.ts:64
Returns an iterator for a tuple of the indexes and items in this array
Returns
Section titled “Returns”IterableIterator<readonly [uint64, TItem]>
keys()
Section titled “keys()”keys():
IterableIterator<uint64>
Defined in: packages/algo-ts/src/mutable-array.ts:71
Returns an iterator for the indexes in this array
Returns
Section titled “Returns”pop():
TItem
Defined in: packages/algo-ts/src/mutable-array.ts:92
Pop a single item from this array
Returns
Section titled “Returns”TItem
push()
Section titled “push()”push(…
items):void
Defined in: packages/algo-ts/src/mutable-array.ts:85
Push a number of items into this array
Parameters
Section titled “Parameters”…TItem[]
The items to be added to this array
Returns
Section titled “Returns”void
slice()
Section titled “slice()”Call Signature
Section titled “Call Signature”slice():
MutableArray<TItem>
Defined in: packages/algo-ts/src/mutable-array.ts:34
Internal
Create a new Dynamic array with all items from this array Not supported yet
Returns
Section titled “Returns”MutableArray<TItem>
Call Signature
Section titled “Call Signature”slice(
end):MutableArray<TItem>
Defined in: packages/algo-ts/src/mutable-array.ts:41
Internal
Create a new MutableArray with all items up till end.
Negative indexes are taken from the end.
Parameters
Section titled “Parameters”An index in which to stop copying items. Not supported yet
Returns
Section titled “Returns”MutableArray<TItem>
Call Signature
Section titled “Call Signature”slice(
start,end):MutableArray<TItem>
Defined in: packages/algo-ts/src/mutable-array.ts:49
Internal
Create a new MutableArray with items from start, up until end
Negative indexes are taken from the end.
Parameters
Section titled “Parameters”An index in which to start copying items.
An index in which to stop copying items Not supported yet
Returns
Section titled “Returns”MutableArray<TItem>