SplitScript reference / [T] / clear

[T].clear

Method

[T].clear() -> None

Removes every element from a growable array.

The array keeps its identity and capacity, so aliases observe the empty result and later appends can reuse its storage. Stored references are released for garbage collection. Exact [T; N] arrays cannot change length and do not support [T].clear. Clearing through any alias invalidates active iteration of this array.

Effects: mutates the receiver

Runtime behavior: available everywhere; synchronous

Examples

Reset discovered checkpoints

let checkpoints: [u32] = [1, 2]
checkpoints.clear()