Skip to documentation
SplitScript
  • Language
  • Standard library
  • Guides
  • Migration

SplitScript reference / Iterable / iterator

Iterable.iterator

Method

T.iterator() -> Iterator where T: 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()
}
Generated from the SplitScript compiler's documentation catalogs.