3 ms·
How does `it` look with two parameters? for example when you have #pairsDo: ? a, b, c, d pairsDo: [:first :second | first append: second] > ab > bc
by VaxWithSex 5y ago
How does `it` look with two parameters?
for example when you have #pairsDo: ?
a, b, c, d pairsDo: [:first :second | first append: second]
> ab
> bc
> cd
- maybe_pablo 5y agoThis would be: listOf("a", "b", "c", "d") .chunked(2) .map { (first, second) -> first + second } Or simply: listOf("a", "b", "c", "d") .chunked(2) { it[0] + it[1] }