Getting the number of elements of a map

suggest change

To get the numbers of elements of a Map, use the .size property:

const map = new Map([[1, 2], [3, 4]]);
console.log(map.size); // 2

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents