How to Get the Size of a Map in JavaScript
In this lesson, we will see how to get the size of a map in JavaScript, sometimes we want to get the size of a map in JavaScript so how can we do that?
The size property
To do that we can use the size property that returns the number of elements in a given map.
const myMap = new Map([['name','john'],['age',22],['city','london']]);
console.log(myMap.size);
//3