delete() method removes the specified element from a
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
- The key of the element to remove from the
true if an element in the
WeakMap object has been removed
false if the key is not found in the
if the key is not an object.
var wm = new WeakMap(); wm.set(window, 'foo'); wm.delete(window); // Returns true. Successfully removed. wm.has(window); // Returns false. The window object is no longer in the WeakMap.
The definition of 'WeakMap.prototype.delete' in that specification.
BCD tables only load in the browser