Join Slack
Powered by
question: when using lambda on list such as `list....
# announcements
f
Fuyang
04/20/2018, 10:09 PM
question: when using lambda on list such as
list.map { process(it) }
, how can I print out the progress? Using onEach and a counter outside?
r
ribesg
04/20/2018, 10:10 PM
You can use mapIndexed
😃 1
❤️ 1
f
Fuyang
04/20/2018, 10:10 PM
let me check
r
ribesg
04/20/2018, 10:12 PM
If you're not actually mapping to any value you should use forEachIndexed
❤️ 1
f
Fuyang
04/20/2018, 10:31 PM
Thank you Gael, it helped a lot 😄
3
Views
Open in Slack
Previous
Next