[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/delete [Back]  [Original]

WeakMap.prototype.delete() - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

WeakMap.prototype.delete()

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 ..

delete() WeakMap.

In this article

wm.delete(key);

key

. , WeakMap.

true WeakMap .

delete

js
var wm = new WeakMap();
wm.set(window, "foo");

wm.delete(window); //  true.  .

wm.has(window); //  false.  window    WeakMap.

Specification
ECMAScript 2027 LanguageSpecification
# sec-weakmap.prototype.delete

Firefox-specific notes

  • Prior to SpiderMonkey 38, this method threw a TypeError when the key parameter was not an object. This has been fixed in version 38 and later to return false as per latest ES6 standard (Firefox bug 1127827).


Web Proxy Viewer  |  New URL  |  Original Page