Using Underscore.js to filter an array of objects on a property using a 'contains'
<p>I have an array of objects which I would like to filter using a contains/any method on a property using underscore.</p>

<p>For example, if I had the following variables:</p>

<pre><code>var people = [
{
    name: 'Dave',
    age: 26
},
{
    name: 'Frank',
    age: 23
}];
var allowedAges = [20, 23, 24];
</code></pre>

<p>I would like to use underscore to end up with a result like:</p>

<pre><code> var allowedPeople = [];
 _.each(_.where(people, { age: _.any()}), function (person) {
            allowedPeople.push(person);
        });
</code></pre>

<p>And there may also be occasions where <em>allowedAges</em> is an array of objects and id want to use the contains/any on the <em>people</em> array using a property of the objects in allowedAges.</p>