The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

delete Method (WeakMap) (JavaScript)

Removes the specified element from a WeakMap object.



Required. A WeakMap object.


Required. The key of the element to remove.

true if the element has been removed.

The following example shows how to add a member to a WeakMap and then delete it.

function Dog(breed) {
    this.breed = breed;

var dog = new Dog("yorkie");

var wm = new WeakMap();
wm.set(dog, "fido");

Supported in the Internet Explorer 11 standards document mode. Also supported in Store apps (Windows 8.1 and Windows Phone 8.1). See Version Information. Not supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards. Not supported in Windows 8.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft