Kotlin HashSet any()
Syntax & Examples


Syntax of HashSet.any()

There are 2 variations for the syntax of HashSet.any() extension function. They are:

1.
fun <T> Iterable<T>.any(): Boolean

This extension function returns true if collection has at least one element.

2.
fun <T> Iterable<T>.any(predicate: (T) -> Boolean): Boolean

This extension function returns true if at least one element matches the given predicate.