Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js filter array of objects by another object

var filtered = myArray.filter(function(i){
    return myFilter.some(function(j){
        return !Object.keys(j).some(function(prop){
            return i[prop] != j[prop];
        });
    });
});

console.log(filtered);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #filter #array #objects #object
ADD COMMENT
Topic
Name
8+7 =