JS: Map.prototype

By Xah Lee. Date: . Last updated: .

(new in ECMAScript 2015)

What is Map.prototype

Map.prototype is the value of the property key "prototype" of the function Map. 〔see Map Object

console.assert(Object.hasOwn(Map, "prototype"));

Type

Type of Map.prototype is Object .

console.assert(typeof Map.prototype === "object");

Parent

Parent of Map.prototype is Object.prototype .

console.assert(Reflect.getPrototypeOf(Map.prototype) === Object.prototype);

Purpose

Purpose of Map.prototype object is to provide methods and properties useful for all map instances.

Map.prototype is the parent of all map instances.

console.assert(Reflect.getPrototypeOf(new Map()) === Map.prototype);

〔see the Map Object Tutorial

Properties

Value Properties

Function Properties

get and set

iteration

JavaScript. Map Object