ES6 - Collections Set Property Size



Returns the number of values in the Set object.

Syntax

Myset.size

Example

var mySet = new Set('tom','jim','jack'); 
var tot = mySet.size; 
console.log(tot);

Output

3 
Advertisements