title: Filter JSON data based on certain properties and values
body: <p>I have the following JSON object:</p>
  
  <pre><code>{
    'name' : 'John',
    'friends' : [
      {
        'id' : 1,
        'name' : 'George',
        'level' : 10
      },
      {
        'id' : 2,
        'name' : 'Stacy',
        'level' : 8
      },
      {
        'id' : 3,
        'name' : 'Fred',
        'level' : 10
      },
      {
        'id' : 4,
        'name' : 'Amy',
        'level' : 7
      },
      {
        'id' : 5,
        'name' : 'Bob',
        'level' : 10
      }
    ]
  }
  </code></pre>
  
  <p>So as you can see, you have an object (person?) that has a <code>name</code>, and an array of <code>friend</code> objects. Each friend object has an <code>id</code>, <code>name</code> and <code>level</code>.</p>
  
  <p>What I'd like to do, is select all the level 10 friends out of that array, and into another variable/object called <code>var level10Friends</code>.</p>
  
  <p>I'm using AngularJS and all this needs to happen in my controller, but this doesn't necessarily have to be an AngularJS specific problem, you're welcome to use vanilla JavaScript functions as well. </p>
  
  <p>To be honest I don't even know if this is possible and searching the web doesn't seem to bring anything up about something like this...</p>