I've got two arrays in Javascript which currently look like this, but are updated by HTTP requests (node):
var x = [[292,"2349","902103","9"],[3289,"93829","092","920238"]]
var y = [[292,"2349","902103","9"],[322,"93829","092","920238"],[924,"9320","8932","4329"]]
I'm looking to compare these arrays, so that, if there is an array inside y that is not in x, it will be saved to a new array - z
. Note that sometimes the order of arrays inside the arrays will change, but I would not like this to affect the result.
If there is an array inside x that is not in y, however, is should not be saved to z
.
I read JavaScript array difference and have been able to replicate this, but if the x
array is not shown in y
, it is printed to z
. I am wondering if it is possible for this not to be stored, only the different items in y
?