title: Array to dynamic function: Use eval or not?
body: <p>Having this object:</p>
  
  <pre><code>// Better as array, thank you for the advice @user2864740
  var rule = [
    ['User', null],
    ['filter', [{ idgroup: 95, active: true}],
    ['order_by', ['name', 'created']]
  ];
  </code></pre>
  
  <p>I want to create a function based on the object above. I only know two ways to do it. First one is using <code>eval</code> and making the function literal:</p>
  
  <pre><code>eval("User.filter({ idgroup: 95, active: true }).order_by('name', 'created')");
  </code></pre>
  
  <p>The other way is more complex and i'm not sure how to approach it yet. But the result should be something like this (With a <code>for/while</code> obviously):</p>
  
  <pre><code>this['User']['filter'].apply(this['User'], [{ idgroup: 95, active: true }])['order_by'].apply(this['User'], ['name', 'created']);
  </code></pre>
  
  <p>Is it worth writing a dynamic function to call the function as the second option, or is eval fast enough to solve this problem?</p>