title: JS, JSON: How to get the n first items respecting 2 conditions?
body: <p><strong>Given data such</strong> :</p>
  
  <pre><code>var people = [ 
  { 'myKey': 'A', 'status': 0, score: 1.5 },
  { 'myKey': 'C', 'status': 1, score: 2.0 },
  { 'myKey': 'D', 'status': 0, score: 0.2 },
  { 'myKey': 'E', 'status': 1, score: 1.0 },
  { 'myKey': 'F', 'status': 0, score: 0.4 },
  { 'myKey': 'G', 'status': 1, score: 3.0 },
  ];
  </code></pre>
  
  <p><strong>How to get all items with <code>'status':1</code> such</strong> </p>
  
  <pre><code>var people2= [ 
  { 'myKey': 'C', 'status': 1, score: 2.0 },
  { 'myKey': 'E', 'status': 1, score: 1.0 },
  { 'myKey': 'G', 'status': 1, score: 3.0 },
  ];
  </code></pre>
  
  <hr>
  
  <p><strong>Edit:</strong> 
  My final aim is to get the n=2 items with <code>'status':1</code> in ascending order, such:</p>
  
  <pre><code>var people3= [ 
  { 'myKey': 'E', 'status': 1, score: 1.0 },
  { 'myKey': 'C', 'status': 1, score: 2.0 },
  { 'myKey': 'G', 'status': 1, score: 3.0 },
  ]; 
  </code></pre>
  
  <p>My approach is one function to get from <code>var people</code> all items of <code>'status':1</code> into <code>people2</code> (it's the code I'am asking right here), one fn to sort <code>people2</code> by ascending score (<code>people3</code>), then one fn to pick <code>'myKey':</code> value of the <code>n=2</code> first items. So I get </p>
  
  <pre><code>var people4 = [ 'E', 'C' ];
  </code></pre>