title: take JSON input and store it in to an array (javascript)
body: <p>I have a JSON input of</p>
  
  <pre><code>{
      "Categories": {
          "Facets": [{
              "count": 1,
              "entity": "Company",
              "Company": [{
  
                  "entity": "Ford Motor Co",
  
                  "Ford_Motor_Co": [{
                      "count": 1,
                      "entity": "Ford"
                  }]
              }]
          }, {
              "count": 4,
              "entity": "Country",
              "Country": [{
  
                  "entity": "Germany",
                  "Germany": [{
                      "count": 1,
                      "entity": "Germany"
                  }],
                  "currency": "Euro (EUR)"
              }, {
  
                  "entity": "Italy",
                  "Italy": [{
                      "count": 1,
                      "entity": "Italy"
                  }],
                  "currency": "Euro (EUR)"
              }, {
  
                  "entity": "Japan",
                  "Japan": [{
                      "count": 1,
                      "entity": "Japan"
                  }],
                  "currency": "Yen (JPY)"
              }, {
  
                  "entity": "South Korea",
                  "South_Korea": [{
                      "count": 1,
                      "entity": "South Korea"
                  }],
                  "currency": "Won (KRW)"
              }]
          }, {
              "count": 5,
              "entity": "Persons",
              "Persons": [{
                  "count": 2,
                  "entity": "Dodge"
              }, {
                  "count": 1,
                  "entity": "Dodge Avenger"
              }, {
                  "count": 1,
                  "entity": "Major League"
              }, {
                  "count": 1,
                  "entity": "Sterling Heights"
              }]
          }]
  
      }
  }
  </code></pre>
  
  <p>I need to get the values for entity in each level in to an array..</p>
  
  <pre><code>[Company, Ford Motor Co, Ford, ....... , Sterling Heights]
  </code></pre>
  
  <p>I am able to get thru the first level with the code</p>
  
  <pre><code>for (var k in h.Categories.Facets)
  {
  
  alert(h.Categories.Facets[k].entity);
  
  }
  </code></pre>
  
  <p>How do I reach thru the innerlevels to get the values of entity??</p>