I tried looking at a similar question in stack overflow but it didn't cater to exactly what I'm trying to do and I keep trying to make it work but continuously get the wrong results. At this point I'm simply 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) {
//code to compare both arrays and find a match
}
console.log(Intersect(compareArray, masterArray))
And the output would be
[9,11,13,15]
[1,2,5,6]
[5,13]
[13,15]
[1,9,11]is not in the final result?