I have 3 arrays
Array1 = ["u101", "u102", "u103", "p101"];
Array2 = ["u101", "u102", "u103", "u104"];
Array3 = ["p101"]
after comparing Array1 and Array2 I need to push "u104" into Array1 and remove "p101" by comparing it with Array3 dynamically.
expected final array would be
newArray = ["u101", "u102", "u103", "u104"];
Can this be achieved with single line of code using ES6 verson of javascript.
All other similar questions are like how to get the unmatched elements or matched elements after comparing two arrays. But here, I need to push those unmatched elements into one of the arrays.
Thank you.