August 2018
Beginner
178 pages
4h 56m
English
Any returns true if the supplied predicate function matches any of the collection items:
val numbers = listOf(1, 2, 3, 4, 5)val hasEvens = numbers.any { n -> n % 2 == 0 }
Any would return true in this case, as the predicate matches two items.
Read now
Unlock full access