JavaScript WeakMap constructor Property Last Updated : 29 May, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report JavaScript WeakMap constructor property is used to return the WeakMap constructor function for the object. The function returned by this property is just the reference, not the actual WeakMap. It is an object property of JavaScript and can be used with Strings, Numbers, etc. Syntax: weakset.constructor Return Type: WeakMap() { [native code] } Below examples will illustrate the WeakSet Constructor Property: Example 1: In this example, we will see the basic use of WeakSet Constructor Property in JavaScript. JavaScript function fun(){ let x = new WeakMap(); console.log(x.constructor) } fun(); Output: Æ’ WeakMap() { [native code] } Example 2: In this example, we will use this property to print on the browser window JavaScript function myGeeks() { let looseSet = new WeakMap(); console.log(looseSet.constructor); } myGeeks() Output[Function: WeakMap] Supported Browsers: Google Chrome Edge Firefox InternetOpera Safari We have a complete list of Javascript WeakMap methods, to check those please go through Javascript WeakMap Reference article Comment More infoAdvertise with us Next Article JavaScript weakMap delete() Method S shobhit_sharma Follow Improve Article Tags : JavaScript Web Technologies Similar Reads JavaScript WeakMap() Constructor The WeakMap() Constructor produces WeakMap objects that are a key/value pair array in which the key is referenced weakly. The keys should be objects and the values could be arbitrary. The difference between Map and WeakMap is that keys must be objects and are only weakly referenced. This means that 2 min read JavaScript WeakMap constructor Property JavaScript WeakMap constructor property is used to return the WeakMap constructor function for the object. The function returned by this property is just the reference, not the actual WeakMap. It is an object property of JavaScript and can be used with Strings, Numbers, etc. Syntax: weakset.construc 1 min read JavaScript weakMap delete() Method The weakMap.delete() is an inbuilt function in JavaScript which is used to delete a particular element from an object WeakMap. Syntax: weakMap.delete(key); Parameters: It accepts a parameter "key" which is the key of the element which is going to be deleted from the object weakMap. Return values: It 2 min read JavaScript weakMap get() Method The Javascript weakMap.get() is an inbuilt function in JavaScript that is used to return a particular element from an object WeakMap. Syntax: weakMap.get(key);Parameters: It accepts a parameter "key" which is the key of the element which is going to be returned from the object weakmap. Return values 2 min read JavaScript weakMap has() Method The Javascript weakMap.has() is an inbuilt function in JavaScript that is used to return a boolean value which indicates whether an element with a particular key is present in the weakmap object or not. Syntax: weakMap.has(key);Parameters: It accepts a parameter 'key' which is the key of the element 2 min read JavaScript weakMap set() Method The weakMap.set() is an inbuilt function in JavaScript which is used to set a new element with a particular key and value to a WeakMap object. Syntax: weakMap.set(key, value); Parameters: It takes parameters "key" which is the key of the element which is to set to the WeakMap object and parameter "v 2 min read Like