Last Updated : 23 Jul, 2025
The map constructor property in JavaScript is used to return the map constructor function for the object. The function which is returned by this property is just the reference to this function, not a map containing the function's name. The JavaScript map constructor, string constructor, and boolean constructor return function Map() { [native code] }, function String() { [native code] }, and function Boolean() { [native code] } respectively.
Syntax:
map.constructor
Return Value: Map() { [native code] }
Example 1: This example shows the basic use of the Map constructor property in JavaScript.
JavaScript
function func() {
let map1 = new Map([
[1, 2],
[2, 3],
[4, 5]
]);
let value = map1.constructor;
console.log(value);
}
func();
Output:
ƒ Map() { [native code] }
Example 2: This example uses the Map constructor Property of Javascript.
JavaScript
function myGeeks() {
let map1 = new Map([
[1, 2],
[2, 3],
[4, 5]
]);
console.log(map1.constructor);
}
myGeeks()
Supported Browsers:
We have a complete list of JavaScript Map methods, to check those please go through the JavaScript Map Reference article
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4