ivano
11/05/2021, 1:24 PMsbyrne
11/05/2021, 1:32 PMtake(5)
even if there are fewer than 5, and you'll just get all of them.ivano
11/05/2021, 1:39 PMAstronaut4449
11/07/2021, 5:55 AMtake
or any other function did not work for both cases you should write it like this:
val items = if (condition) a() else b()
items.forEach { commonAction(it) }
ivano
11/07/2021, 11:33 AM