`listOf(1, 2, 3, 4, 5, 6).chunked(2, { it[0] to it...
# getting-started
h
listOf(1, 2, 3, 4, 5, 6).chunked(2, { it[0] to it[1] }).toMap()
seems to work, but you're creating a
List
for every map entry... (EDIT: Cleaned up thanks to karelpeeters)
i
When you pass a lambda to
chunked
it is applied immediately to each chunk list and then the list is reused for the next chunk