title: Getting & Using JSON Object Key Names
body: <p>I have a bunch of json files that I need to read and save as a text file. The problem is the names of the keys in each json file differs. I've seen the use of the function Object.keys to obtain the key names, but, for example, in such a file:</p>
  
  <pre><code>    {
          "mainKey1" : 
          [
              {
                  "subKey1" : "Value 1",
                  "subKey2" : "Value 2",
                  "subKey3" : "Value 3"
              },
              {
                  "subKey1" : "Value 1",
                  "subKey2" : "Value 2",
                  "subKey3" : "Value 3"
              }
          ],
  
          "mainKey2" : 
          [
              {
                  "subKey1" : "Value 1",
                  "subKey2" : "Value 2",
                  "subKey3" : "Value 3"
              },
              {
                  "subKey1" : "Value 1",
                  "subKey2" : "Value 2",
                  "subKey3" : "Value 3"
              }
          ]
      }   
  </code></pre>
  
  <p>How could I get the names "mainKey1","mainKey2", and so on, and also "subKey1", subKey2", and so on.</p>
  
  <p>Finally, after obtaining these key names, how could I use them to read the corresponding "Value1", "Value2", "Value3".</p>
  
  <p>Thanks in advance!</p>