title: Javascript dynamic conditioning
body: <p>I want to build a <code>IF</code> condition which is built dynamically based on the parameters it gets. More over, this is expected to be built as a plugin.<br>
  For instance, there are 3 parameters for student object, called age,name, phone_numbers. Also, there is a option object for selection parameters.<br>
  In the condition,  </p>
  
  <pre><code>if(student.age &gt;option.age  &amp; student.name == option.name &amp; student.phonenumbers == option.phonenumbers ){
  // do stuff 
  }
  </code></pre>
  
  <p>If any parameter is missing, it should not be included in the condition. For example, assume, in case option.name is undefined, then the if condition should be prepared as following,  </p>
  
  <pre><code>if(student.age &gt;option.age &amp; student.phonenumbers == option.phonenumbers ){
      // do stuff 
      }  
  </code></pre>
  
  <p>Moreover, why this kind of thing is required is, here an array of (500 objects)  students objects are iterated. The above condition can be splitted into seperat conditions, but then the iteration will be multipled by the number of conditions !!!. So I m looking for a way to add all conditions into one.</p>
  
  <p>However, my approach is, create the expression as a string and then execute it with <code>eval(..)</code>,but as far as I know that using <code>eval</code> can lead vulnerabilities.  </p>
  
  <p>Any one let me know a way to implement a dynamic conditions.</p>