title: Dynamic conditions of array for javascript
body: <pre><code>const conditionalArray = [
    { name: &quot;line&quot;, condition: &quot;&gt;=&quot;, value: 5 },
    { name: &quot;revene&quot;, condition: &quot;in&quot;, value: 6 },
  ];
  
  const dataTofilter = [
    { line: 3, revene: 4, sale: 3, fridge: &quot;lg&quot; },
    { line: 6, revene: 3, sale: 2, fridge: &quot;samsung&quot; },
  ];
  </code></pre>
  <p>I have these 2 arrays one is having conditions ( many more can be there) and second is to filter</p>
  <p>Final result should be <code>[{ line: 6, revene: 3, sale: 2, fridge: &quot;samsung&quot; }]</code></p>