JS列表去重

const config = [
    '11111',
    '11221',
    '11441',
    '11111',
]

const set = new Set(config);
console.log(set);

  运行结果:

$ node a.js
Set(3) { '11111', '11221', '11441' }

  

posted on 2022-09-12 17:30  清清飞扬  阅读(184)  评论(0编辑  收藏  举报