删除数组重复的元素 es6 const animals = ['bears', 'lions', 'tigers', 'bears', 'lions']const unique = (arr) => [...new Set(arr)]console.log(unique(animals)) // [ 'bears', 'lions', 'tigers' ] es6 2024-06-03 39 点赞 0 评论 59 浏览