标签:
<script>
function subArr(arr) {
var obj = {};
return arr.filter(function(n) {
return obj[n] ? false : (obj[n] = true)
})
}
console.log(subArr([1, 2, 3, 4, 1, 2, 3, 4, 5, 6]));
</script>
标签:
原文地址:http://www.cnblogs.com/mouse2417/p/5165351.html