new Set Array.form

new Set(),用来去重数组。
 
let arr = [1, 2, 2, 3];
let set = new Set(arr);
let newArr = Array.from(set);
console.log(newArr); // [1, 2, 3]
原文地址:https://www.cnblogs.com/xiaoxiaoxun/p/12157608.html