remove the items in array which are present in another javascript

Solutions on MaxInterview for remove the items in array which are present in another javascript by the best coders in the world

showing results for - "remove the items in array which are present in another javascript"
Phineas
19 Oct 2019
1var myArray = [
2  {name: 'deepak', place: 'bangalore'}, 
3  {name: 'chirag', place: 'bangalore'}, 
4  {name: 'alok', place: 'berhampur'}, 
5  {name: 'chandan', place: 'mumbai'}
6];
7var toRemove = [
8  {name: 'deepak', place: 'bangalore'},
9  {name: 'alok', place: 'berhampur'}
10];
11
12
13
14myArray = myArray.filter(ar => !toRemove.find(rm => (rm.name === ar.name && ar.place === rm.place) ))