interface HashMap<K,V>
A type-invariant immutable Map of key type K, and value type V. In the Map, each key has exactly one value, and the Map cannot contain duplicate keys. See the Map documentation and the HashMap API documentation
Companion namespace: HashMap
Implemented by: HashMap.NonEmpty<K,V>
Type parameters
| Name | Description |
|---|---|
| K | the key type |
| V | the value type |
note
- The
HashMapuses the context'shasherinstance to hash keys for performance.
- TheHashMapuses the context'seqfunction to determine equivalence between keys.
example
const m1 = HashMap.empty<number, string>()
const m2 = HashMap.of([1, 'a'], [2, 'b'])