When coding in JavaScript, I am faced with the following problem:
A = [1,2,3,4,5];
B = [3,4,6];
C = ??? // Need a solution here
console.log(c); // The expected result is [1,2,5]
I initially thought that this task could be easily achieved using lodash, but I have not been able to find a single function that does it. As a workaround, I came up with the following code snippet:
C = _.intersection(A, _.xor(A,B));
Is there any specific function that I may have overlooked for solving this issue?