SplitScript reference / Iterable / iterator

Iterable.iterator

Method

Self.iterator() -> Iterator where Self: Iterable

Creates an independent cursor over this value.

Advancing the cursor does not consume the iterable value itself.

Effects: pure

Runtime behavior: available everywhere; synchronous

Examples

Create a cursor

state "game.exe" {}

onAttach {
    let iterator = [1, 2].iterator()
}