JS: Map.prototype.size

By Xah Lee. Date: . Last updated: .

(new in ECMAScript 2015)

mapObj.size

Return the total count of entries in mapObj.

console.assert((new Map([[3, 3], [4, 4]])).size === 2);

JS Map.prototype