var arr=[1,2,3,4,4];
console.log([...new Set(arr)]);
// 1,2,3,4
参考
Get all unique values in a JavaScript array (remove duplicates)
var arr=[1,2,3,4,4];
console.log([...new Set(arr)]);
// 1,2,3,4
Get all unique values in a JavaScript array (remove duplicates)
让时间为你证明