es6数组去重

2019-04-29  本文已影响0人  waterte

let arr=[1,1,2,2,NaN,NaN];

let arr2 = Array.from(new Set(arr));  

arr2即为去重后的结果

上一篇 下一篇

猜你喜欢

热点阅读