I want to create a list but if a certain condition...
# announcements
p
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()
     }
}