I have an array of objects (all the same object type). I have another array of the same object type in which I want to use to tell me which objects to delete from the first array. Is there an easy way to do this besides looping through all properties and comparing them to find the elements in the first array that 100% match the elements in the second array and then deleting from the first array?
I’m basically doing a jQuery.grep() on an array of objects and the resulting array from this grep I want to delete from the array I passed into it.
Instead of using jQuery.grep(), to obtain a new array, replace it with jQuery.map(), returning the same object if it must be kept, or null if you want to remove it.
If for instance your code is
Change it to