`has()` 方法根据 `WeakSet` 是否存在相应对象返回布尔值。

## 语法

    ws.has(value);

### 参数

value
  必须。 测试 `WeakSet 中是否存在该对象。`

### 返回值

Boolean
  如果 `WeakSet` 对象中存在指定的元素，返回 true；否则返回 `false。`

## 示例

### 使用 `has` 方法

    var ws = new WeakSet();
    var obj = {};
    ws.add(window);

    mySet.has(window);  // 返回 true
    mySet.has(obj);     // 返回 false

## 规范

Specification | Status | Comment
--- | --- | ---
ECMAScript 2015 (6th Edition, ECMA-262) WeakSet.prototype.has | Standard | Initial definition.
ECMAScript Latest Draft (ECMA-262) WeakSet.prototype.has | Draft |

## 浏览器兼容性

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 (Gecko) | Internet Explorer | Opera | Safari
--- | --- | --- | --- | --- | ---
Basic support | 36 | 34 (34) | 未实现 | 23 | 未实现

Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile
--- | --- | --- | --- | --- | ---
Basic support | 未实现 | 34.0 (34) | 未实现 | 未实现 | 未实现

## 相关链接

- `WeakSet`
- `WeakSet.prototype.add()`
- `WeakSet.prototype.delete()`