Join Slack
Powered by
I want to create a list but if a certain condition...
# announcements
p
poohbar
09/22/2017, 9:43 PM
I want to create a list but if a certain condition is met the list should be reversed. Does this seem readable to you?
Copy code
val myList= listOf("A", "B", "C", "D").let { if (condition) { it.reversed() } }
Open in Slack
Previous
Next