I want to search a JSON object to check if it contains string values stored in an array. and figure out the parent elements.
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",
        },
    }
};
I want to pass the results into a function. And deal with them separate.
name_1a -> function(title2b, object)
name_2y -> function(title2y, object)
name_3x -> function(title1x, location) etc.
. This is what I have tried so far. I can't seem to figure out how to gothrough the entire JSON object
var searchVal = ['name_1a','name_2y','name_3x'];
  for (var i=0 ; i < searchVal.length ; i++){
    for (var k=0 ; k < ????.length ; k++)
    {
      if (json.???????? == searchVal[i]) {
        results.push(???????);
        console.log(results);
      }
    }
  }
 
     
     
     
     
    