const conditionalArray = [
{ name: "line", condition: ">=", value: 5 },
{ name: "revene", condition: "in", value: 6 },
];
const dataTofilter = [
{ line: 3, revene: 4, sale: 3, fridge: "lg" },
{ line: 6, revene: 3, sale: 2, fridge: "samsung" },
];
I have these 2 arrays one is having conditions ( many more can be there) and second is to filter
Final result should be [{ line: 6, revene: 3, sale: 2, fridge: "samsung" }]
ObjectandArray.{ name: "revene", condition: "in", value: 6 }supposed to mean?revene in 6is invalid syntax.in: (a, b) => b.includes(a)or similar as a function property in the approach below, right? The question still saysvalue: 6instead ofvalue: "abc"and numbers cannot be searched by contents.