Standard built-ins
WeakSet.prototype.delete()
Remove a member and indicate whether it existed.
Formal Syntax & Structure
javascript syntaxjavascript
weakSet.delete(value)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| value | Object | nonregistered Symbol | Eligible weak member. |
Return Value
Boolean
Whether the stated condition holds.
Working Example
Example Snippetjavascript
const k={};const s=new WeakSet([k]);console.log(s.delete(k),s.delete(k));