In addition to the solutions provided by @Audi, there’s also forEachIndexed:
collection.forEachIndexed { index, element ->
// ...
}
In addition to the solutions provided by @Audi, there’s also forEachIndexed:
collection.forEachIndexed { index, element ->
// ...
}