title: ES6 - Destructuring assignment - Unpack some properties from existing object to a new object?
body: <p>Is it possible to unpack some of the keys of an object to a new object?</p>
  
  <p>Let's say, I want to copy 3 of the keys (<code>a</code>, <code>b</code>, <code>c</code>) from <code>test</code> object to a new object (<code>abc</code>). Below mention code will work. </p>
  
  <pre><code>const test = {a:1, b:2, c:3, d:4, e:5 };
  const {a, b, c} = test;
  const abc = { a, b, c, f: 6};
  </code></pre>
  
  <p><strong>Is there any approach with which I can do it in a single statement?</strong></p>
  
  <p>There is one more approach.</p>
  
  <pre><code>const test = {a:1, b:2, c:3, d:4, e:5 };
  const abc = { ...test, f: 6};
  </code></pre>
  
  <p>But with this approach, I would later have to delete the unwanted keys (<code>d</code>, <code>e</code> in my case).</p>
  
  <p>(Best Case Solution: If we don't have to keep track of unwanted keys. There can be n number of unwanted keys.)</p>