js 数组去重(es6一行代码实现)

it2024-11-06  5

let arr = [1, 2, 3, 4, 2, 1]; var b = [...new Set(arr)]; console.log(b);

结果:

最新回复(0)