let's assume I have two lists. One existing with some names and a new one with maybe some new names, deleted names or still the same names.
var currentList = ['Daniel', 'Lara', 'Horst'];
var newList = ['Mario', 'Lara'];
// Expected result
toDelete = ['Daniel', 'Horst'];
toAdd = ['Mario'];
At the end I need two arrays which contains the new names and those which can be deleted. The names which appear in both array can be ignored.
I don't really know what to call this type of "sorting", so even a buzzword could help. Notice I don't have jQuery at all.
Thanks in advance.