Standard built-ins

WeakSet.prototype.has()

Try the free JavaScript compiler

Test membership for a supplied value without exposing other members.

Formal Syntax & Structure

javascript syntaxjavascript
weakSet.has(value)

Parameters & Attributes

NameTypeDescription
valueObject | nonregistered SymbolEligible weak member.

Return Value

Boolean

Whether the stated condition holds.

Working Example

Example Snippetjavascript
const k={};console.log(new WeakSet([k]).has({}));
JavaScript Reference