Given the excludes and items arrays, I want to return an array of objects from items that don’t contain a key, value pair corresponding to a key, value pair object in excludes. Is there a better way of solving this other than using nested for loops?
const excludes = [{key: "color", value: "Red"}, {key: "age", value:12}, {key:"score", value: 75}];
const items = [{color: "Red", score: 30, age: 12}, {color: "Blue", score: 100, age: 20}, {color: "Red", score: 75, age: 30}];
//Expected output: [{color: "Blue", score: 100, age: 20}]