Standard built-ins
Map.prototype.delete()
Remove a key and return whether an entry existed.
Formal Syntax & Structure
javascript syntaxjavascript
map.delete(key)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| key | Any | Map key; object keys use identity. |
Return Value
Boolean
Whether the stated condition holds.
Working Example
Example Snippetjavascript
const m=new Map([["a",1]]);console.log(m.delete("a"),m.delete("a"));