JavaScript: Map.prototype.size

By Xah Lee. Date: . Last updated: .

New in JS2015.

mapObj.size
Return the total count of entries in mapObj.
console.log(
  (new Map([[3, "n3"], [4, "n4"]])).size === 2,
);
BUY
ΣJS
JavaScript in Depth