JS: Map.prototype.delete
New in JS2015.
mapObj.delete(key)
-
Deletes the entry of key in mapObj.
Return
true
if found, elsefalse
.const xx = new Map([[3, "n3"], [4, "n4"], [5, "n5"]]); // delete a entry. return true if found console.log(xx.delete(5)); console.log(xx.delete(99) === false); console.log(xx); // Map { 3 => 'n3', 4 => 'n4' }
JS Map.prototype
- JS: Map.prototype.constructor
- JS: Map.prototype.size
- JS: Map.prototype[Symbol.toStringTag]
- JS: Map.prototype.get
- JS: Map.prototype.set
- JS: Map.prototype.has
- JS: Map.prototype.delete
- JS: Map.prototype.clear
- JS: Map.prototype.forEach
- JS: Map.prototype.entries
- JS: Map.prototype.keys
- JS: Map.prototype.values
- JS: Map.prototype.entries