Filtering Array of JSON objects : <p>I am attempting to filter an array of JSON objects. I am new to JavaScript and trying to do it in coding languages that I used to. Basically, I want to take the following array of objects.</p>

<pre><code>     var result = [
                                {
                                    date : '2016-11-21',
                                    name: 'Bob',
                                    score: 0.1034947
                                },

                                {
                                    date : '2016-10-21',
                                    name: 'Bill',
                                    score: 0.2081911},

                                {
                                    date : '2016-10-21',
                                    name: 'Mary',
                                    score: 0.234947
                                },
                                {
                                    date : '2016-10-21',
                                    name: 'Bob',
                                    score: 0.1034947
                                },

                                {
                                    date : '2016-11-21',
                                    name: 'Bill',
                                    score: 0.2081911},

                                {
                                    date : '2016-11-21',
                                    name: 'Mary',
                                    score: 0.234947
                                },
                                {
                                    date : '2016-12-21',
                                    name: 'Bob',
                                    score: 0.1034947
                                },

                                {
                                    date : '2016-12-21',
                                    name: 'Bill',
                                    score: 0.2081911},

                                {
                                    date : '2016-12-21',
                                    name: 'Mary',
                                    score: 0.234947
                                }




  ]
</code></pre>

<p>I then want to filter based on objects. So for example.</p>

<pre><code>var selected_Names = ['Bob','Mary']
</code></pre>

<p>I want to return Bob and Mary's information only in this scenario.</p>

<pre><code> [
                                {
                                    date : '2016-11-21',
                                    name: 'Bob',
                                    score: 0.1034947
                                },



                                {
                                    date : '2016-10-21',
                                    name: 'Mary',
                                    score: 0.234947
                                },
                                {
                                    date : '2016-10-21',
                                    name: 'Bob',
                                    score: 0.1034947
                                },



                                {
                                    date : '2016-11-21',
                                    name: 'Mary',
                                    score: 0.234947
                                },
                                {
                                    date : '2016-12-21',
                                    name: 'Bob',
                                    score: 0.1034947
                                },



                                {
                                    date : '2016-12-21',
                                    name: 'Mary',
                                    score: 0.234947
                                }




  ]
</code></pre>

<p>Thanks!</p>
