this time I have the following problem, I'm getting from my database an array of objects, which is updated every few minutes, the problem is that this array can come with new objects or deleted objects compared to its previous array.. example;
first data entry
[
{name: 'Paul', color: 'blue', age: '7'},
{name: 'Lisa', color: 'rose', age: '4'}
]
second data entry ( an object is added )
[
{name: 'Paul', color: 'blue', age: '7'},
{name: 'Lisa', color: 'rose', age: '4'},
{name: 'Adam', color: 'green', age: '11'}
]
third data entry ( an object is deleted )
[
{name: 'Paul', color: 'blue', age: '7'},
{name: 'Adam', color: 'green', age: '11'}
]
I need to detect and verify which element was added or deleted compared to the first entry, try to do a forEach to do it through the keys but it is impossible to use it since the order of the objects varies.
How could I get these differences?