SplitScript reference / [T] / pop

[T].pop

Method

[T].pop() -> T?

Removes and returns the final element when one exists.

An empty array returns None without changing its structural version. Otherwise the array keeps its identity and capacity, aliases observe the shorter length, and active iteration is invalidated. Exact [T; N] arrays cannot change length and do not support pop.

Effects: mutates the receiver

Runtime behavior: available everywhere; synchronous

Examples

Consume the most recently discovered checkpoint

let checkpoints: [u32] = [1, 2]
let checkpoint = checkpoints.pop() else return