JS数组去重,用ES6的 new Set 方法很方便
let list = ['1','qq','bb','hh','qq']
const set = new Set(list)
list = [...set]
这舒爽,谁用谁知道呢~
JS数组去重,用ES6的 new Set 方法很方便
let list = ['1','qq','bb','hh','qq']
const set = new Set(list)
list = [...set]
这舒爽,谁用谁知道呢~
本文标题:VUE ES6 new Set实现数组去重
本文链接:https://www.haomeiwen.com/subject/wbqwpktx.html
网友评论