title: Getting key of each object inside array of objects into an array: Javascript
body: <p>I have an object with the following format</p>
  
  <pre><code>var obj = [{
    "a": 1
  }, {
    "b": 2
  }, {
    "c": 3
  }];
  </code></pre>
  
  <p>Would want to fetch only keys out of each object inside this array of objects into a new array</p>
  
  <p>Something like this:
  <code>["a","b","c"]</code></p>
  
  <p>Have tried the following but it is not working : </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 obj = [{
    "a": 1
  }, {
    "b": 2
  }, {
    "c": 3
  }];
  let result = obj.map (({ val }) =&gt; val)
  console.log(result);</code></pre>
  </div>
  </div>
  </p>