JS 最简单数组去重

var newArr = Array.from(new Set([1,2,2,3,4])) // 再把set转变成array
 console.log(newArr) // [1,2,3,4]
相关文章
相关标签/搜索