Standard built-ins

Set.prototype.has()

Try the free JavaScript compiler

Check membership using SameValueZero without converting value types.

Formal Syntax & Structure

javascript syntaxjavascript
set.has(value)

Parameters & Attributes

NameTypeDescription
valueAnyValue to associate or insert.

Return Value

Boolean

Whether the stated condition holds.

Working Example

Example Snippetjavascript
console.log(new Set([NaN]).has(NaN));
JavaScript Reference