1.Array.from
const items = new Set([1, 2, 3, 4, 5, 5]); //去重
const array = Array.from(items); //1.转成数组
- 1
- 2
2.扩展运算符 …
const items = new Set([1, 2, 3, 4, 5, 5]); //去重
const array1 = [...items]; //2.转成数组
1.Array.from
const items = new Set([1, 2, 3, 4, 5, 5]); //去重
const array = Array.from(items); //1.转成数组
2.扩展运算符 …
const items = new Set([1, 2, 3, 4, 5, 5]); //去重
const array1 = [...items]; //2.转成数组