title: JavaScript - Filter Nested Arrays
body: <p>I'm trying to filter an array in javascript, and am struggling when the array is nested.</p>
  
  <p>At the moment, the furthest I've been able to get is filtering a flat array:</p>
  
  <pre><code>var ID = 3
  
  var arr = [{ id : 1, name: "a" }, { id : 2, name: "b" }, { id : 3, name: "c" }]
  
  var result = arr.filter(function( obj ) {return obj.id == ID;});
  alert(result[0].name);
  </code></pre>
  
  <p>Though the above doesn't work if the array looks like this instead:</p>
  
  <pre><code>var arr2 = [
      [{ id : 1, name: "a" },{ id : 2, name: "b" }],
      [{ id : 3, name: "c" },{ id : 4, name: "d" }]
  ] 
  </code></pre>
  
  <p>The two examples can be found: <a href="https://jsfiddle.net/vjt45xv4/" rel="noreferrer">https://jsfiddle.net/vjt45xv4/</a></p>
  
  <p>Any tips for finding the appropriate result on the nested array would be much appreciated.</p>
  
  <p>Thanks!</p>