last one is the simplest ``` fun <T> Iterab...
# announcements
d
last one is the simplest
Copy code
fun <T> Iterable<T>.batch(chunkSize: Int) = this
        .mapIndexed { i, item -> i to item }. // create index value pairs
        .groupBy { it.first / chunkSize }.    // create grouping index
        .map { it.value.map { it.second } }   // split into different partitions
❤️ 1
m
danneu: Wonderful, thanks. I was thinking in a functional way to split an array in chunks 👍