new Set(a)
let b = new Set(a)
b = Array.from(b)
const a = [1, 3, 3, 1];
let b = new Set(a); //数组a为可迭代对象,b此时为Set结构
b = Array.from(b); //Set为可迭代对象,b此时为数组结构
console.log(b);
new Set(a)
b=[...b]
const a = [1, 3, 3, 1];
let b = new Set(a); //数组a为可迭代对象,b此时为Set结构
b = [...b]; //将Set数组b中的每一个元素展开,赋值给数组结构b
console.log(b);