I've seen this, but it doesn't return the desired result, which would be:
[
[4, "frente", 196],
[5, "frente", 196]
]
function getUniqueData(arr = [
[4, "frente", 196],
[4, "frente", 196],
[5, "frente", 196]
], uniqueCols = [0]) {
const uniqueData = arr.filter((currentRow, i) => {
const currentCombo = uniqueCols.map(index => currentRow[index]);
return !arr.some((row, j) => {
const combo = uniqueCols.map(index => row[index]);
return combo.every((c1, k) => c1 === currentCombo[k]) && i !== j;
});
});
return uniqueData;
}
console.log(getUniqueData())