hasValue
Checks whether a value exists anywhere in a Map (Map.prototype.has checks keys, not values).
Uses Object.is-style equality (via ===, with NaN matching NaN).
Available since v3.0.3
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
map | ReadonlyMap<K, V> | The Map to search |
value | V | The value to look for |
Returns
Section titled “Returns”boolean — true if the value is found in at least one entry
Examples
Section titled “Examples”Check whether a value exists in a Map
Section titled “Check whether a value exists in a Map”Unlike Map.prototype.has (which checks keys), this checks values.
Value absent
Section titled “Value absent”Returns false when no entry has that value.
