Map.prototype
Map.prototype
Map.prototype
属性表示Map
构造函数的原型对象。
| Map.prototype
属性的属性特性 |
|:----|
| Writable | no |
| Enumerable | no |
| Configurable | no |
描述
Map
实例继承自Map.prototype
。你可以使用这个构造函数的原型对象来给所有的Map
实例添加属性或者方法。
属性
Map.prototype.constructor
Returns the function that created an instance's prototype. This is the Map
function by default.Map.prototype.size
Returns the number of key/value pairs in the Map
object.
方法
Map.prototype.clear()
移除Map对象的所有键/值对 。
规范
Specification | Status | Comment |
---|---|---|
ECMAScript 2015 (6th Edition, ECMA-262)The definition of 'Map.prototype' in that specification. | Standard | Initial definition. |
ECMAScript Latest Draft (ECMA-262)The definition of 'Map.prototype' in that specification. | Draft | |
浏览器兼容性
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 38 | (Yes) | 13 (13) | 11 | 25 | 7.1 |
Feature | Android | Chrome for Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Basic support | No support | 38 | (Yes) | 13.0 (13) | No support | No support | 8 |