数组去重

91 阅读1分钟

arr.reduce((acc, cur) => {

    if (!(acc.includes(cur))) { 

        acc.push(cur)

    } 

    return acc 

}, [])