set数组去重

174 阅读1分钟
let arr = [1, 5, 6, 8, 8, 1, 6, 7]
<!-- Array.from 将set对象转换为数组  set对象具有唯一性 -->
arr = Array.from(new Set([...arr]))