title: Finding index of value in two dimensional array of objects in javascript
body: <p>I have a 2D array of objects like so:</p>
  
  <pre><code>[[{id: 123}, {id: 456}, {id: 789}], [{id: 111}, {id: 222}, {id: 333}], [{id: 444}, {id: 555}, {id: 666}], [{id: 777}]]
  </code></pre>
  
  <p>I need to find the index of the id at the top array level.</p>
  
  <p>So if i was to search for and id property with value '222' i would expect to return an index of 1.</p>
  
  <p>I have tried the following:</p>
  
  <pre><code>var arr = [[{id: 123}, {id: 456}, {id: 789}], [{id: 111}, {id: 222}, {id: 333}], [{id: 444}, {id: 555}, {id: 666}], [{id: 777}]],
      len = arr.length
      ID = 789;
  
  for (var i = 0; i &lt; len; i++){
      for (var j = 0; j &lt; arr[i].length; j++){
          for (var key in o) {
              if (key === 'id') {
                  if (o[key] == ID) {
                      // get index value 
                  }
              }
          }           
      }
  }
  </code></pre>