Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

filter repetition 2d array 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]]
Comment

PREVIOUS NEXT
Code Example
Javascript :: filter duplicates multidimensional array javascript 
Javascript :: javascript slice array 
Javascript :: count documents mongoose 
Javascript :: mysql json_array_append 
Javascript :: generate random color 
Javascript :: vue toggle boolean on click 
Javascript :: js fibonacci sequence 
Javascript :: react native vector icons 
Javascript :: js object clear 
Javascript :: Burger menu bulma React 
Javascript :: react native new project mac 
Javascript :: nanoid 
Javascript :: remove duplicates array.filter 
Javascript :: js copy paragraph onclick 
Javascript :: javascript detect tab leave 
Javascript :: reload datatable 
Javascript :: unix to date in javascript 
Javascript :: how to make a string with unique characters js 
Javascript :: sum all values of an array 
Javascript :: javascript check if property exists in object 
Javascript :: date js add days 
Javascript :: how to check checkbox using jquery 
Javascript :: jquery code to make click function 
Javascript :: delete node modules 
Javascript :: even or odd in javascript 
Javascript :: randomize an array in javascript 
Javascript :: js for loops 
Javascript :: discord.js embed timestamp 
Javascript :: comment out in javascript 
Javascript :: javascript select n random from array 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =