JS 最簡單數組去重

var newArr = Array.from(new Set([1,2,2,3,4])) // 再把set轉變成array
 console.log(newArr) // [1,2,3,4]
相關文章
相關標籤/搜索