title: How do I search a JSON object for a specific string value?
body: <p>I want to search a JSON object to check if it contains string values stored in an array. and figure out the parent elements.</p>
  
  <pre><code>var searchVal = ['name_1a','name_2y','name_3x'];
  
  var json = {
  "location": {
          "title1x": {
              "1": "name_1x",
              "2": "name_2x",
              "3": "name_3x",
          },
         "title2y": {
              "1": "name_1y",
              "2": "name_2y",
              "3": "name_3y",
          },
      }
  
      "object": {
          "title1a": {
              "1": "name_1z",
              "2": "name_2z",
              "3": "name_3z",
          },
         "title2b": {
              "1": "name_1a",
              "2": "name_2a",
              "3": "name_3a",
          },
      }
  };
  </code></pre>
  
  <p>I want to pass the results into a function. And deal with them separate.</p>
  
  <pre><code>name_1a -&gt; function(title2b, object)
  name_2y -&gt; function(title2y, object)
  name_3x -&gt; function(title1x, location) etc.
  </code></pre>
  
  <p>.
  This is what I have tried so far. I can't seem to figure out how to gothrough the <strong>entire</strong> JSON object</p>
  
  <pre><code>var searchVal = ['name_1a','name_2y','name_3x'];
    for (var i=0 ; i &lt; searchVal.length ; i++){
      for (var k=0 ; k &lt; ????.length ; k++)
      {
        if (json.???????? == searchVal[i]) {
          results.push(???????);
          console.log(results);
  
        }
      }
    }
  </code></pre>