All I need to do is compare two arrays of objects and remove items in the second one that have the same property value. For example:
var a = [{\'name\':\'bob
Instead of using two loops you might also use the findIndex function:
for (var i = 0, len = a.length; i < len; i++) {
var ItemIndex = b.findIndex(b => b.name === a[i].name);
a.splice(ItemIndex, 1)
}
Or if you want to go completely without using a loop you might use the forEach function
a.forEach(function(item, index, array) {
var ItemIndex = b.findIndex(b => b.name === item.name);
a.splice(ItemIndex, 1)
}