To get the numbers of elements of a Map, use the .size property:
.size
const map = new Map([[1, 2], [3, 4]]); console.log(map.size); // 2