I am confused on what are the advantages/disadvantages of each of these approaches (assuming I need to use both index and product):
products.forEachIndexed{ index, product ->
...
}
for ((index, product) in products.withIndex()) {
...
}
products here is a simple collection.
Is there any performance/best practice/etc argument to prefer one over the other?