Kotlin HashMap count()
Syntax & Examples


Syntax of HashMap.count()

There are 2 variations for the syntax of HashMap.count() extension function. They are:

1.
fun <K, V> Map<out K, V>.count(): Int

This extension function returns the number of entries in this map.

2.
fun <K, V> Map<out K, V>.count( predicate: (Entry<K, V>) -> Boolean ): Int

This extension function returns the number of entries matching the given predicate.