I have two arrays of objects like:
[{id: "1", name: "item1", checked: true}, {id: "2", name: "item2", checked: true}, {id: "3", name: "item3", checked: true}]
and
[{id: "1", name: "item1", checked: true}, {id: "2", name: "item2", checked: true}, {id: "3", name: "item3", checked: false}]
The first array holds the default states, the second one hold the current states. I'd like to filter out the objects that "checked" is changed. The expected result would be
[{id: "3", name: "item3", checked: false}]
I tried with loadash differentBy, but it returns empty array:
const diff=_.differenceBy(array1, array2, "checked")
Can anyone help out? Thanks.