title: JavaScript map - select one property from array with name
body: <p>I have this array:</p>
  
  <pre><code>[{a: 1, b: 2}, {a: 2, b: 3}, {a: 3, b: 1},...]
  </code></pre>
  
  <p>and I would like to convert to this array:</p>
  
  <pre><code>[{a:1}, {a:2}, {a: 3}]
  </code></pre>
  
  <p>I tried this:</p>
  
  <pre><code>array.map(x =&gt; {'a': x.a}) 
  </code></pre>
  
  <p>but this is a mistake (its giving error).
  is there any function in JavaScript that can do this? Thanks</p>