How to remove all combination with the same element in subarray from array?

I have this array [[1,2,3],[4,1,6],[1,3,2],[1,2,4],[3,1,2],[4,6,1],[9,9,9]] and I want a function that do this: [[1,2,3],[4,1,6],[1,2,4],[9,9,9]]. This function removes all subarray with the same value. I thought about a filter like this .filter(el => el.filter(value => array2.includes(value))) But I don’t think it will work. PS: I use node.js EDIT: Weirdly, many of your answer work PERFECTLY with…

Discover more