在线文档教程

Map.prototype

Map.prototype

Map.prototype属性表示Map构造函数的原型对象。

| Map.prototype属性的属性特性 |

|:----|

| Writable | no |

| Enumerable | no |

| Configurable | no |

描述

Map实例继承自Map.prototype。你可以使用这个构造函数的原型对象来给所有的Map实例添加属性或者方法。

属性

Map.prototype.constructorReturns the function that created an instance's prototype. This is the Map function by default.Map.prototype.sizeReturns the number of key/value pairs in the Map object.

方法

Map.prototype.clear()移除Map对象的所有键/值对 。

规范

SpecificationStatusComment
ECMAScript 2015 (6th Edition, ECMA-262)The definition of 'Map.prototype' in that specification.StandardInitial definition.
ECMAScript Latest Draft (ECMA-262)The definition of 'Map.prototype' in that specification.Draft

浏览器兼容性

FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support38(Yes)13 (13)11257.1

FeatureAndroidChrome for AndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic supportNo support38(Yes)13.0 (13)No supportNo support8