title: Extract Unique Keys from an array of Objects
body: <p>I have an array of objects which looks like this:</p>
  
  <pre><code>[  
     {  
        "a":"alpha",
        "b":{  
           "x":true,
           "y":true
        }
     },
     {  
        "a":"beta",
        "b":{  
           "x":true,
           "z":true
        }
     }
  ]
  </code></pre>
  
  <p>I want to loop through this array to get a qnique list of all keys of 'b' alone. So, that my resulting array will be:</p>
  
  <pre><code>[x,y,z]
  </code></pre>
  
  <p>I tried the following:</p>
  
  <pre><code>const mykeys = myArray.map(item =&gt; Object.keys(item.b))
  </code></pre>
  
  <p>However, this only gves me: [[x,y], [y,z]]</p>
  
  <p>How can I get the result as [x,y,z] instead.</p>