title: How to Get JSON data keys and inner keys to from new object in Javascript
body: <p>I have a JSON, from that I need to extract all the keys in the JSON. so far I extracted all keys, But I need to from multidimensional array with only key values. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
    "coord": {
      "lon": -0.13,
      "lat": 51.51
    },
    "weather": [
      {
        "id": 300,
        "main": {
          "submain": "Drizzle"
        },
        "description": "light intensity drizzle",
        "icon": "09d"
      }
    ]
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>I need to construct mulit-dimensional array something like this...</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>["coord",["lon","lat"],"weather",[["id","main","description",["small_descript","large_description"],"icon"]....] </code></pre>
  </div>
  </div>
  
  code that I had used is...</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var keyValue1= [];
  function keyList(obj) 
  {
   Object.keys(obj).forEach(function(key) {
       keyValue1.push(key);
       if(typeof(obj[key]) == 'object')
       {
        keyList(obj[key]);
       } 
   });
   
  }
  
  
  var obj = {"coord":{"lon":-0.13,"lat":51.51},"weather":[{"id":300,"main":"Drizzle","description":{"small_descript":"light intensity drizzle","large_descript":"light intensity drizzle"},"icon":"09d"}],"base":"stations","main":{"temp":280.32,"pressure":1012,"humidity":81,"temp_min":279.15,"temp_max":281.15},"visibility":10000,"wind":{"speed":4.1,"deg":80},"clouds":{"all":90},"dt":1485789600,"sys":{"type":1,"id":5091,"message":0.0103,"country":"GB","sunrise":1485762037,"sunset":1485794875},"id":2643743,"name":"London","cod":200};
  keyList(obj);
  console.log(keyValue1);</code></pre>
  </div>
  </div>
  </p>