Apply your JS skills to key Mozilla projects as an MDN Fellow!

Your Search Results


    This is an experimental technology, part of the Harmony (ECMAScript 6) proposal.
    Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future version of browsers as the spec changes.


    The delete() method removes the specified element from a WeakMap object.




    Required. The key of the element to remove from the WeakMap object.

    Return value

    Returns true if an element in the WeakMap object has been removed successfully.


    Example: Using the delete method

    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.


    Specification Status Comment
    ECMAScript 6 (ECMA-262)
    The definition of 'WeakMap.prototype.delete' in that specification.
    Draft Initial definition.

    Browser compatibility

    Feature Chrome Firefox (SpiderMonkey) Internet Explorer Opera Safari
    Basic support 36 6.0 (6.0) 11 23 7.1
    Feature Android Firefox Mobile (SpiderMonkey) IE Mobile Opera Mobile Safari Mobile
    Basic support Not supported 6.0 (6.0) Not supported Not supported iOS 8

    See also

    Document Tags and Contributors

    Contributors to this page: realityking, fscholz
    Last updated by: realityking,