Closed FezVrasta closed 5 years ago
you can use lodash difference achieve it. https://lodash.com/docs/4.17.10#difference
^ Or you could use this:
const diff = arr => arr.reduce((a, b) => a.filter(c => !b.includes(c)))
Taken from here:
let arrays = [[1, 2, 3, 4, 5], [5, 2, 10]]; console.log(arrays.reduce((a, b) => a.filter(c => !b.includes(c)))); // output: [1, 3, 4]
Hi,
I need to get just a simple list of the items that have been changed or added in an array, without any other information.
How can I achieve it?