I tried to address a similar issue in a stack overflow, but it did not satisfy exactly what I was trying to do, and I continue to try to get it to work, but constantly get the wrong results. At this moment, I'm just at a loss. Example of what i mean
var masterArray = [[1,2,5,6],[5,13,7,8],[9,11,13,15],[13,14,15,16],[1,9,11,12]]
var compareArray = [9,11,13,15,1,2,5,6]
function intersect(a, b) {
}
console.log(Intersect(compareArray, masterArray))
And the output will be
[9,11,13,15]
[1,2,5,6]
[5,13]
[13,15]