Standard built-ins
Map.prototype.has()
Test presence using key identity and SameValueZero, independently of value.
Formal Syntax & Structure
javascript syntaxjavascript
map.has(key)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| key | Any | Map key; object keys use identity. |
Return Value
Boolean
Whether the stated condition holds.
Working Example
Example Snippetjavascript
console.log(new Map([[NaN,0]]).has(NaN));