Filter applies the supplied predicate function to the collection and returns the following result:
val numbers = listOf(1, 2, 3, 4, 5)
val smallerThan3 = numbers.filter { n -> n < 3 }
The resulting list has these numbers [1, 2].
Filter applies the supplied predicate function to the collection and returns the following result:
val numbers = listOf(1, 2, 3, 4, 5)
val smallerThan3 = numbers.filter { n -> n < 3 }
The resulting list has these numbers [1, 2].
18.116.43.124