方法`has()` 返回一个bool值，用来表明map 中是否存在指定元素.

## 语法

    myMap.has(key);

### 参数

key
  必填. 用来检测是否存在指定元素的键值.

### 返回值

Boolean
  如果指定元素存在于Map中，则返回true。其他情况返回false

## 案例

### 使用has方法

    var myMap = new Map();
    myMap.set("bar", "foo");

    myMap.has("bar");  // returns true
    myMap.has("baz");  // returns false

## 规范

Specification | Status | Comment
--- | --- | ---
ECMAScript 2015 (6th Edition, ECMA-262) Map.prototype.has | 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

浏览器 | Chrome谷歌 | Firefox (Gecko)火狐 | Internet Explorer | Opera | Safari
--- | --- | --- | --- | --- | ---
兼容版本 | 38 | 13.0 (13.0) | 11 | 25 | 7.1

浏览器 | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile
--- | --- | --- | --- | --- | --- | ---
兼容版本 | 未实现 | 38 | 13.0 (13.0) | 未实现 | 未实现 | 8

## 相关链接

- `Map`
- `Map.prototype.set()`
- `Map.prototype.get()`