Compare array objects and show difference
问题 I have two arrays which I want to compare and check if there is an deleted item in one of these arrays. If there is show me the difference (deleted item) Here is the code below how I would like to achieve this: var completedList = [{id:1},{id:2},{id:3},{id:4},{id:7},{id:8}]; var invalidList = [{id:3},{id:4},{id:5},{id:6}]; // filter the items from the invalid list, out of the complete list var validList = completedList.map((item) => { console.log(item.id) return item.id; //console.log