For-In Loop
Iterate over collections or ranges with for-in.
Syntax
for (element in collection) {
// body
}
Iterating a Collection
for (item in items) {
Process(item);
}
With Range
for (i in 0..10) {
Print(i);
}
Next Steps
- Parallel For — Multi-threaded loops