JS: Map.prototype

By Xah Lee. Date: . Last updated: .

New in ES2015.

Map.prototype is the value of the property key "prototype" of the function Map.

[see JS: Map Object]

console.log( Map.hasOwnProperty ( "prototype" ) ); // true

Type

Type of Map.prototype is object.

[see JS: Value Types]

console.log ( typeof Map.prototype === "object" ); // true

console.log ( Object.prototype.toString.call( Map.prototype ) === "[object Map]" ) // true

Parent

Parent of Map.prototype is Object.prototype.

console.log ( Reflect.getPrototypeOf ( Map.prototype ) === Object.prototype ); // true

[see JS: Prototype and Inheritance]

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.log ( Reflect.getPrototypeOf ( new Map() ) === Map.prototype ); // true

[see JS: the Map Object Tutorial]

Properties

value properties

  1. Map.prototype.constructor
  2. Map.prototype.size
  3. Map.prototype.[Symbol.toStringTag]

get, set

  1. Map.prototype.get
  2. Map.prototype.set
  3. Map.prototype.has
  4. Map.prototype.delete
  5. Map.prototype.clear

loop

  1. Map.prototype.forEach
  2. Map.prototype.entries
  3. Map.prototype [ Symbol.iterator ] → same as Map.prototype.entries
  4. Map.prototype.keys
  5. Map.prototype.values

JS Map

  1. the Map Object Tutorial
  2. Iterate Over Map Object
  3. Convert Object to/from Map
  4. Map Filter
  5. Reverse Key/Value

Like it? Help me by telling your friends. Or, Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials

  1. HTML
  2. CSS
  3. JavaScript
  4. JS Obj Ref
  5. DOM
  6. SVG
  7. Blog