set的使用

const _arr = [1, 2, 3, 4, 5, 5, 5, 5];
console.log(..._arr);//解构
console.log(new Set(_arr));//去重值是唯一的
///
console.log([...new Set(_arr)])//去重值是唯一的
posted @ 2018-09-26 17:11  一叶*秋  阅读(111)  评论(0编辑  收藏  举报

博客侧边栏公告广告位招租