filter array of objects with array of objects

Solutions on MaxInterview for filter array of objects with array of objects by the best coders in the world

showing results for - "filter array of objects with array of objects"
Alessio
05 Sep 2017
1const myArray = [{ userid: "100", projectid: "10", rowid: "0" }, { userid: "101", projectid: "11", rowid: "1"}, { userid: "102", projectid: "12", rowid: "2" }, { userid: "103", projectid: "13", rowid: "3" }, { userid: "101", projectid: "10", rowid: "4" }];
2const myFilter = [{ userid: "101", projectid: "11" }, { userid: "102", projectid: "12" }, { userid: "103",  projectid: "11"}];
3
4const myArrayFiltered = myArray.filter((el) => {
5  return myFilter.some((f) => {
6    return f.userid === el.userid && f.projectid === el.projectid;
7  });
8});
9
10console.log(myArrayFiltered);
queries leading to this page
filter arrays of objects with arrayarray of objects filterhow to filter an array of objects in javascriptfilter objects in existing arraybest way to filter one array of object from another array of stringfilter out array of objects within an array of objectsjavscript filter function in array of objectshow to filter objects in an array jsjs filter array of objectsfilter list of objects javascriptjavascript filter objects in one arrayhow to filter objects from array of objects from another array of object in javascriptjavascript how to filter an array of objectsfilter array of objects javascript based on valuefilter with new array of objectshow to filter array of objects in javascriptjavascript filter array of objects 21 3d 3dnodejs filter object in object arrayjavascipt filter method array of objectsfilter array of objects in javascriptjs array of objects filterfilter array for single objectfilter an array with a obj propfilter array of objects javascriptfilters array object javascriptfilter an array of objects in javascriptfilter through an array of objectsfilter javascript array of objectsdelete from array of objects javascript filterhow to filter an array of objects in an array of objects in javascriptfilter array of objects by property javascriptfilter array of objectses6 filter array of objectsarray filter on array of objectsfilter array of objectfilter values from array of objects javascriptarray filter on array of objectsfilter through array of objects javascriptfilter array of objects javascript based on propertyfilter array of objects for propertyfiltering through array of objectsfilter array of objects by one filedhow to use filter array of value on array of objects in javascriptfilter a value from an array of objectsjavascript filter array of objectsjavascript filter object array objectfilter array of objects with keyfilter array of objects with array of objects