## 概述

`delete()` 方法可以从一个 `WeakMap` 对象中删除指定的元素。

## 语法

    wm.delete(key);

### Parameters参数

key
  需要删除的元素的键

### 返回值

如果成功删除，返回 `true`，否则返回 `false`。

## 示例

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

    wm.delete(window); // 返回 true，表示删除成功。

    wm.has(window);    // 返回 false，因为 window 对象已经被删除了。

## 规范

Specification | Status | Comment
--- | --- | ---
ECMAScript 2015 (6th Edition, ECMA-262) WeakMap.prototype.delete | Standard | Initial definition.

## 浏览器兼容性

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

- Desktop
- Mobile

Feature | Chrome | Firefox (SpiderMonkey) | Internet Explorer | Opera | Safari
--- | --- | --- | --- | --- | ---
Basic support | (Yes)[1] | 6.0 (6.0) | 11 | 未实现 | 未实现

Feature | Android | Firefox Mobile (SpiderMonkey) | IE Mobile | Opera Mobile | Safari Mobile
--- | --- | --- | --- | --- | ---
Basic support | 未实现 | 6.0 (6.0) | 未实现 | 未实现 | 未实现

## 相关链接

- `WeakMap`