Standard built-ins
WeakMap.prototype.delete()
Remove association if present; return false when absent.
Formal Syntax & Structure
javascript syntaxjavascript
weakMap.delete(key)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| key | Object | nonregistered Symbol | Eligible weak key. |
Return Value
Boolean
Whether the stated condition holds.
Working Example
Example Snippetjavascript
const k={};const w=new WeakMap([[k,1]]);console.log(w.delete(k),w.has(k));