//方法1 const s = new Set(); [2,3,4,4,5,3,6,3,2].forEach(x => s.add(x)); for(let i of s){ console.log(s); } //方法2 const set = new Set([1, 2, 3, 4, 4]); [...set]