Package: effect
Module: MutableHashMap
Returns the number of key-value pairs in the MutableHashMap.
When to use
Use to read how many entries are currently stored in the mutable hash map.
Example (Checking map size)
import { MutableHashMap } from "effect"
const map = MutableHashMap.empty<string, number>()
console.log(MutableHashMap.size(map)) // 0
MutableHashMap.set(map, "key1", 42)
MutableHashMap.set(map, "key2", 100)
console.log(MutableHashMap.size(map)) // 2
MutableHashMap.remove(map, "key1")
console.log(MutableHashMap.size(map)) // 1
MutableHashMap.clear(map)
console.log(MutableHashMap.size(map)) // 0
See
isEmpty for checking whether the map has no entriesSignature
declare const size: <K, V>(self: MutableHashMap<K, V>) => number
Since v2.0.0