SplitScript reference / [T]

[T]

type constructor

[T]

Stores an indexed sequence of values.

[T] accepts any length, while [T; N] carries an exact length and can provide a fixed process-memory layout. Both forms use WebAssembly GC storage and expose the same generic length, access, and mutation operations.

Examples

Store a typed sequence

let inventory: [u8] = [1, 2, 3]

Methods

MemberDescriptionAvailable through
clearRemoves every element from a growable array.
containsReports whether the array contains an equal element.
extendAppends every element from another array.
indexOfFinds the first index containing an equal element.
isEmptyReports whether the array contains no elements.
iteratorCreates an independent cursor over this array.
lengthReturns the number of array elements.
popRemoves and returns the final element when one exists.
pushAppends an element to a growable array.
removeRemoves the first element equal to a value.
removeAtRemoves the element at an index and shifts later elements left.
setUpdates an array element.