Map/Set to maintain unique array of arrays, Javascript
One way would be to convert the arrays to JSON strings, then use a Set to get unique values, and convert back again var arr = [ [1, 1, 2], [1, 2, 1], [1, 1, 2], [1, 2, 1], [2, 1, 1], [2, 1, 1] ]; let set = new Set(arr.map(JSON.stringify)); let arr2 = Array.from(set).map(JSON.parse); … Read more