Map.prototype 属性表示 Map构造函数的原型对象。
Map.prototype 属性的属性特性: |
|
|---|---|
| writable | false |
| enumerable | false |
| configurable | false |
Map 实例继承自Map.prototype。你可以使用这个构造函数的原型对象来给所有的Map实例添加属性或者方法。
Map.prototype.constructorMap函数。Map.prototype.sizeMap.prototype.clear()Map.prototype.delete(key)Map 对象中存在该元素,则移除它并返回 true;否则如果该元素不存在则返回 falseMap.prototype.entries()Iterator 对象,它按插入顺序包含了Map对象中每个元素的 [key, value] 数组。Map.prototype.forEach(callbackFn[, thisArg])Map对象里的每一键值对调用一次callbackFn函数。如果为forEach提供了thisArg,它将在每次回调中作为this值。Map.prototype.get(key)Map.prototype.has(key)Map.prototype.keys()Iterator对象, 它按插入顺序包含了Map对象中每个元素的键 。Map.prototype.set(key, value)Map.prototype.values()Iterator对象,它按插入顺序包含了Map对象中每个元素的值 。Map.prototype[@@iterator]()Iterator对象,它按插入顺序包含了Map对象中每个元素的 [key, value] 数组。| Specification | Status | Comment |
|---|---|---|
| ECMAScript 2015 (6th Edition, ECMA-262) Map.prototype |
Standard | Initial definition. |
| ECMAScript Latest Draft (ECMA-262) Map.prototype |
Draft |
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | 38 | 13 (13) | 11 | 25 | 7.1 |
| Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Basic support | 未实现 | 38 | 13.0 (13) | 未实现 | 未实现 |
8 |