题解 | #数组去重#
数组去重
http://www.nowcoder.com/practice/7a26729a75ca4e5db49ea059b01305c9
<script type="text/javascript">
const _deleteRepeat = array => {
// 补全代码
let map = new Map();
let res = [];
for(let i = 0; i < array.length; i++){
if(!map.has(array[i])){
map.set(array[i],1);
res.push(array[i])
}
}
return res;
}
</script>