Skip to content
IsaacShelton edited this page Mar 21, 2022 · 1 revision

Idx

idx is a variable created by the compiler, which is a mutable reference to the current iteration index within repeat and each-in loops

repeat 10 {
    print(idx)
}

each String in names {
    printf("names[%zu] = %S\n", idx, it)
}

Type

idx is always of type usize

Clone this wiki locally