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
| Member | Description | Available through |
|---|---|---|
| clear | Removes every element from a growable array. | |
| contains | Reports whether the array contains an equal element. | |
| extend | Appends every element from another array. | |
| indexOf | Finds the first index containing an equal element. | |
| isEmpty | Reports whether the array contains no elements. | |
| iterator | Creates an independent cursor over this array. | |
| length | Returns the number of array elements. | |
| pop | Removes and returns the final element when one exists. | |
| push | Appends an element to a growable array. | |
| remove | Removes the first element equal to a value. | |
| removeAt | Removes the element at an index and shifts later elements left. | |
| set | Updates an array element. |