JS: Set.prototype.size

By Xah Lee. Date: . Last updated: .

(new in ECMAScript 2015)

mySet.size

Return the total count of values in mySet.

console.assert((new Set([4, 5, 6])).size === 3);

JS Set, Size Add Remove