I have two arrays:
var collectionA = [
{'name': 'Brandon', 'age': '41'}
];
var collectionB = [
{'name': 'Brandon', 'age': '41'},
{'name': 'Tom', 'age': '25'},
{'name': 'Jimmy', 'age': '36'},
{'name': 'Brian', 'age': '36'}
];
How can I get create a third array that is basically the result of subtracting collectionA
from collectionB
? FYI: I'm using Underscore and Backbone in this project and would love to do this with one or the other.
The third array would look like this:
var collectionC = [
{'name': 'Tom', 'age': '25'},
{'name': 'Jimmy', 'age': '36'},
{'name': 'Brian', 'age': '36'}
];