SplitScript reference / [T]

[T]

type constructor

[T]

Stores an indexed sequence of values.

[T] creates growable values, while [T; N] carries an exact length and can provide a fixed process-memory layout. An omitted shape in a helper parameter is inferred, so read-only helpers accept both forms without erasing an exact length. Structural mutation constrains the receiver to a growable array. Both forms use WebAssembly GC storage and expose the same length, indexed access, element replacement, search, and iteration APIs.

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.