title: _.filter() and new Function in nodejs
body: <p>This is what I have, please let me know how to get the filter to properly filter through the dictionary using the new <code>Function</code> process.</p>
  <pre><code>let _ = require('underscore');
  let inventory = [{'id':1, 'color':'red', 'size':'large'}, {'id':2, 'color':'orange', 'size':'small'}, {'id':3, 'color':'orange', 'size':'large'}, {'id':4, 'color':'red', 'size':'small'}, {'id':1, 'color':'orange', 'size':'small'}];
  
  let criteria = 'size==large, id&gt;2';
  
  let data = _.filter(data, new Function(criteria));
  </code></pre>
  <p>This function was meant to return <code>&quot;{'id':3, 'color':'orange', 'size':'large'}&quot;</code> only, not any of the other key-value pairs, but instead I just keep getting errors about how <code>large</code> is not defined. If criteria is <code>&quot;id&gt;2&quot;</code>, then the error says that 2 is not defined</p>