I need to get only the difference between two arrays
I tried:
let arr1 = {
"data": [{
"id": "EID_Floss",
"name": "Floss",
"te": "dd"
}]
}
let arr2 = {
"data": [{
"id": "EID_Floss",
"name": "Floss"
}]
}
JSON.stringify(arr2.data.filter((x) => !arr1.data.includes(x)))
Result:
[{
"id": "EID_Floss",
"name": "Floss"
}]
How to get only this:
[{
"te": "dd"
}]