Standard built-ins

Map.prototype.has()

Try the free JavaScript compiler

Test presence using key identity and SameValueZero, independently of value.

Formal Syntax & Structure

javascript syntaxjavascript
map.has(key)

Parameters & Attributes

NameTypeDescription
keyAnyMap 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));
JavaScript Reference