title: Destructuring object using typescript/javascript
body: <p>I have a bit JSON object with over 50 keys like</p>
  <pre><code>const data = {a:1, b:2, c:3,....,y:99,z:100}
  </code></pre>
  <p>and 2 arrays containing keys of this json object</p>
  <pre><code>const arr1 = [&quot;a&quot;, &quot;b&quot;, &quot;m&quot;, &quot;l&quot;, &quot;x&quot;, &quot;y&quot;, &quot;Z&quot;]
  const arr2 = [&quot;c&quot;, &quot;d&quot;, &quot;g&quot;, &quot;h&quot;, &quot;i&quot;, &quot;k&quot;, &quot;q&quot;]
  </code></pre>
  <p>Now I want to copy all the value from <code>data</code> object into 2 new objects which contain only data of those keys which are present in <code>arr1</code> and <code>arr2</code> into 2 objects</p>