I have the 2 below lists:
array_main = [[01-0158969,315],[01-0161045,699],[01-0161046,500]]
array_helper_both = [[01-0158969,315],[01-0161045,699],[01-0161050,500]]
I am trying to compare array_main with array_helper_both and if there are any differences (elements PRESENT in array_main but not in array_helper_both), then I am trying to add it to array_helper_both. For example, "01-0161046" is in array_main but not in array_helper_both.
Hence array_helper_both result would be:
[[01-0158969,315],[01-0161045,699],[01-0161050,500],[01-0161046,500]]
This is the code I tried but doesn't seem to work:
var list3 = array_helper_both.filter(x => !array_main.includes(x));
var list4 = array_helper_both.concat(array_main.filter(x => !array_helper_both.includes(x)));
Any leads/suggestions would be appreciated.