effect-io-ai

Package: effect
Module: HashMap

HashMap.size

Returns the number of entries within the HashMap.

Example (Getting the size)

import { HashMap } from "effect"

const emptyMap = HashMap.empty<string, number>()
const map = HashMap.make(["a", 1], ["b", 2], ["c", 3])

console.log(HashMap.size(emptyMap)) // 0
console.log(HashMap.size(map)) // 3

Signature

declare const size: <K, V>(self: HashMap<K, V>) => number

Source

Since v2.0.0