Remove duplicate elements in an array
2016-12-20 20:53
253 查看
<script> [1,2,3,4,5,4,3,2,1].filter(function(element,index,arr){ return arr.indexOf(element)==index; //[1, 2, 3, 4, 5] }); </script>
相关文章推荐
- remove duplicate element in an array
- Remove Duplicate Elements from an Array using jQuery
- Find the Smallest K Elements in an Array
- Find All Duplicates in an Array
- Find All Duplicates in an Array
- Find the two non-repeating elements in an array of repeating elements
- leetcode 442 Find All Duplicates in an Array C++
- Finding all elements(which are integer) in an array whose sum is equals to the element exists within
- LeetCode Find All Duplicates in an Array
- How do I remove a particular element from an array in JavaScript?
- leetcode442 Find All Duplicates In An Array Java
- LeetCode-442-Find All Duplicates in an Array-M
- 算法(11)Find All Duplicates in an Array
- Find All Duplicates in an Array
- Two Methods to Remove Duplicates in an ArrayList
- LeetCode 442 Find All Duplicates in an Array
- Find All Duplicates in an Array
- LeetCode - Find All Duplicates in an Array
- remove duplicated value in an array
- Algorithm: efficient way to remove duplicate integers from an array