I have the map posted below in the code section. I added some values to the map as shown.But when i tried to display the contents of the map using
\'getOwnPropertyNames\' as sh
A map does not have properties (which would be limited to string and symbol keys). It stores its elements on the inside. To iterate through a Map, use its entries, values, keys, or implicit iterator methods with a for … of loop:
for (const [key, value] of mymap) {
console.log(key, value);
}