(1..100).map { i -> AnimalPlanet( __use i here__) }
👍 1
m
morozov
07/19/2017, 9:08 AM
thx, now i understand
b
bamdmux
07/19/2017, 9:09 AM
No prob
g
gildor
07/19/2017, 9:18 AM
Same for List builder function, you have access to index as lambda parameter.
approach with list builder just little bit more efficient (no additional range and iterator instances)
👍 1
b
bamdmux
07/19/2017, 9:42 AM
Yeah of course, is just Im used to range and map and thats what comes to mind faster 🙂