var set = new Set(['a', 'b', 'c', 'c']);
console.log(set); //a, b, c
var set2 = new Set('abcc');
console.log(set2); //a, b, c
var set3 = new Set([1, 2, 3, 3]);
console.log(set3); //1, 2, 3
var set = new Set();
//add
set.add(1);
set.add(2);
set.add(3);
set.add({name: 'Lin'});
console.log(set);
//entries
var itr = set.entries(); //iterator object
for (const [v, k] of itr)
console.log(v, k);
//forEach
set.forEach((value) => console.log(value));
//has
console.log(set.has(2));
//values
var itr2 = set.values(); // iterator object
for (const v of itr2)
console.log(v);
var set = new Set(['a', 'b', 'c', 'c']);
set.delete('a');
console.log(set); //{'b', 'c'}
set.clear();
console.log(set); //{}