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

It

it is a variable created by the compiler, which is a mutable reference to the current entry within an each-in loop

each String in names {
    print("Hello " + it + "!")
}

The name of it can be overridden by specifying a name before the element type in an each-in loop

each firstname String in names {
   print("Hello " + firstname + "!")
}
Clone this wiki locally