es6 数组去重

思路:数组转set集合,set集合再转为数组

let array = Array.from(new Set([1, 1, 1, 2, 3, 2, 4]));

console.log(array); // => [1, 2, 3, 4]

原文地址:https://www.cnblogs.com/vae860514/p/10929750.html