let set = new Set(); console.log(set); // add set.add(1); set.add({}); console.log([...set]); // has console.log(set.has(1)); // true // delete console.log(set.delete(1)); // true console.log([...set]); console.log(set); // clear set.clear(); console.log(set.size); let set2 = new Set(['red', 'green', 'blue']); for (let item of set2.keys()) { console.log(item); } for (let item of set2.entries()) { console.log(item); }