I have two arrays that I want to compare and push values that are not the same in both to a new array. Basically I'm trying to push values from arrayTwo that are not in arrayOne to a new array.
var arrayOne = [[1,"121"], [2,"111"], [2,"321"], [3,"232"], [3,"213"], [4,"211"]],
arrayTwo = [[4,"111"], [1,"131"], [3,"321"], [3,"232"], [3,"211"], [3,"213"], [1, "X1X"]];
doNotMatch = [];
I tried looping through the first two arrays comparing the values like below but this obviously isn't working:
for ( var i = 0; i < arrayOne.length; i++ ) {
for ( var e = 0; e < arrayTwo.length; e++ ) {
if ( arrayOne[i] !== arrayTwo[e]) {
doNotMatch.push(arrayTwo[e])
}
}
}