I'm trying to delete duplicate letters in each multidimensional array but am having trouble with the syntax between a single array vs a multidimensional array. I can get it to work for a single array as follows:
function uniq(a) {
return Array.from(new Set(a))
}
// uniq([8,7,8]) successfully returns [8,7]
But it would not work for code like this:
uniq([[8,7,8],[6,8]])
How could this be achieved? Similarly I was trying to make a simple function that just increases the MD array values by 1 but that did not work either:
[[4,6,1],[4,9]].map(function(c,i,a){ return c[i+1] });
There are similar questions like this one, but in my case, each multidimensional array is different, and it's the letters in those MD arrays I want to remove duplicates from. Thanks for any help here.