Let's say I have:
let object1 = [{id: 15, name: name1}, {id: 0, name: name2}, {id: 98, name: name3}];
let object2 = [{id: 2, action: action}, {id: 88, action: action}, {id: 0, action: action}];
ID numbers don't match on purpose. How could I get name values from object1 whose ID's don't appear in object2?
Edit: I've tried to
let results;
for (let i = 0; i < object1.length; i++) {
results = object2.filter(element => { return element.id != object1[i].id } );
}
Also tried to get it working with .map(), but with no luck.