let arr = [1,2,2,3,4,4,45,5,5,5,55,55,5]; let s = new Set(arr); //结果:Set {1,2,3,4} let newArr = Array.from(s); //结果:[1,2,3,4],完成去重
本文标题:js 数组去重
本文链接:https://www.haomeiwen.com/subject/maobmftx.html
网友评论