Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

filter duplicates javascript

var arr = [[7,3], [7,3], [3,8], [7,3], [7,3], [1,2]];

arr.map(JSON.stringify).reverse().filter((e, i, a) => a.indexOf(e, i+1) === -1).reverse().map(JSON.parse) // [[7,3], [3,8], [1,2]]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #filter #duplicates #javascript
ADD COMMENT
Topic
Name
3+8 =