title: Return values from an array based on dynamic array of keys
body: <p>I have an array of keys and I want to iterate of them and return their corresponding values. </p>
  
  <p>Generally, I know, I can just do a <code>object.key_name</code> or <code>object[key_name]</code> but I have a dynamic array and will populate with different keys.</p>
  
  <p>Data:</p>
  
  <pre><code>data = [{hello: 'abc', asd: '123', fgh: '345' }, 
  {hello: 'sdf', asd: '456', fgh: 'df' }, 
  {hello: 'ty', asd: '789', fgh: '345675' },
  {hello: 'qwe', asd: '123', fgh: '987' }]
  </code></pre>
  
  <p>array format: <code>arr = ['asd', 'fgh']</code></p>
  
  <p>I am trying to do: <code>let x = data.map(o =&gt; arr.map(strs =&gt; o[strs]));</code></p>
  
  <p>Result:</p>
  
  <pre><code>["123", "345"]
  ["456", "df"]
  ["789", "345675"]
  ["123", "987"]
  </code></pre>
  
  <p>Is there any way for me to get:</p>
  
  <pre><code>["123", "456", "789", "123"]  &lt;= array for asd
  ["345", "df", "345675", "987"] &lt;= array for fgh
  </code></pre>