title: How to Extract Value Keys From JSON
body: <p>I have following JSON format and I want to extract keys from it. </p>
  
  <p>I want to get following keys </p>
  
  <p><strong>covg_AccdntDeath_Slf ,<br>covg_DILong_Slf ,<br>covg_LITwentyYr_Slf ,<br>covg_LITenYr_Slf ,<br>covg_GrpOffOvr_Slf ,<br>covg_LIAnnual_Slf ,<br>txtCampaignCode ,<br>associationAccronym</strong></p>
  
  <p>And this is my JSON data:</p>
  
  <pre><code>{  
    "covg_AccdntDeath_Slf":{  
      "txtGNumber":"G-29003-0",
      "txtPlanName":"Accidental Death and Dismemberment Insurance",
      "hidProdCode":"999",
      "rdTypeOfCovg":"New",
      "slidBenefitAmt":"50000",
      "productCategory":"AD"
    },
    "covg_DILong_Slf":{  
      "txtGNumber":"G-29002-0",
      "txtPlanName":"Long Term Disability",
      "hidProdCode":"601-a",
      "rdTypeOfCovg":"New",
      "txtMaxBenefitAmt":"$15,000",
      "selWaitingPeriod":"30 Days",
      "slidMonBenefitAmt":"1000",
      "productCategory":"DI"
    },
    "covg_LITwentyYr_Slf":{  
      "txtGNumber":"G-29005-0",
      "txtPlanName":"20-Year Level Term Life Insurance",
      "hidProdCode":"121",
      "rdTypeOfCovg":"New",
      "slidBenefitAmt":"100000",
      "productCategory":"LI"
    },
    "covg_LITenYr_Slf":{  
      "txtGNumber":"G-29004-0",
      "txtPlanName":"10-Year Level Term Life Insurance",
      "hidProdCode":"102",
      "rdTypeOfCovg":"New",
      "slidBenefitAmt":"100000",
      "productCategory":"LI"
    },
    "covg_GrpOffOvr_Slf":{  
      "txtGNumber":"G-29002-1",
      "txtPlanName":"Office Overhead Expense Disability Insurance",
      "hidProdCode":"603",
      "rdTypeOfCovg":"New",
      "slidBenefitAmt":"1000",
      "txtMaxBenefitAmt":"$20,000",
      "selWaitingPeriod":"30 Days",
      "selBenefitDuration":"24 months",
      "productCategory":"OO"
    },
    "covg_LIAnnual_Slf":{  
      "txtGNumber":"G-29000-0",
      "txtPlanName":"Traditional Term Life Insurance",
      "hidProdCode":"99999",
      "rdTypeOfCovg":"New",
      "slidBenefitAmt":"100000",
      "productCategory":"LI"
    },
    "txtCampaignCode":"",
    "associationAccronym":"ACS"
  }
  </code></pre>
  
  <p>I have tried following code.</p>
  
  <pre><code> &lt;html&gt;
      &lt;head&gt;
          &lt;script&gt;
              var input = above JSON String.
          var keys = [];
          console.log('Length : '+input.length);
          for(var i = 0;i&lt;input.length;i++)
          {
              Object.keys(input[i]).forEach(function(key){
                  if(keys.indexOf(key) == -1)
                  {
                      keys.push(key);
                  }
              });
          }
          console.log('KKKK: '+keys);
          &lt;/script&gt;
      &lt;/head&gt;
  &lt;/html&gt;
  </code></pre>