title: Search object of objects for array value match
body: <p>Given array parameter <code>ary ["value", "value2"]</code></p>
  
  <p>I want to loop through an object of objects to find a match for both array values. I've tried as such:</p>
  
  <pre><code>function findMatch (ary) {
  
    storageArray = [];
    mykeys = [];
    myvalues = [];
  
    for (var i = 0; i &lt; ary.length; i++) {
      for (obj in object) {
        for (key in object[obj]) {
          if (ary[i] in object[obj]) {
             mykeys.push(key);
             myvalues.push(object[obj][ary[i]]);
          }
        }
      }
     storageArray .push(mykeys, myvalues);
     return storageArray;
  }
  
  var object = {
      "subobject" :
      {
          'key'   : 'value',
          'key2'  : 'value2',
          'key3'  : 'value3'      
      },
      "subobject2" : 
      {
          'key4'  : 'value4'
  
      },
  }
  </code></pre>
  
  <p>Goal: be able to return the <code>k : v</code> pair for each match of a value in  <code>ary</code></p>
  
  <p>meaning... since <code>ary</code> has <code>value</code> and <code>value2</code>... I want to return a match from the object of <code>key : value</code> and <code>key2 : value2</code>.</p>
  
  <p>So far this a) isn't working and b) doesn't seem like the most efficient way to do it (3 for loops...)</p>