71
JavaScript WeakSet has() method
The JavaScript WeakSet has() method indicates whether the WeakSet object contains the specified object. It returns true if the specified object is present, otherwise false.
Syntax
The has() method is represented by the following syntax:
Parameter
value – It represents the object to be searched.
Return
A Boolean value.
JavaScript WeakSet has() method example
Let’s see an example to determine whether the WeakSet object contains the specified object.
Output:
true false false
Next TopicWeakSet Method