title: Re-framing array of objects from another array in javascript
body: <p>Want to create one array from another array of objects as below using 
  javascript. <strong>arr</strong> is the input array and it should output as <strong>outArr</strong></p>
  
  <p><strong>Input Array:</strong></p>
  
  <pre><code>var arr = [
      {name: 'A', flag: 0},
      {email: 'B', flag: 0},
      {address: 'C', flag: 0},
      {name: 'A1', flag: 1},
      {email: 'B1', flag: 1},
      {address: 'C1', flag: 1}
  ]
  </code></pre>
  
  <p><strong>Output Array:</strong></p>
  
  <pre><code>var outArr = [
     {
       name: 'A',
       email: 'B',
       address: 'C'
     },
     {
       name: 'A1',
       email: 'B1',
       address: 'C1'
     }
  ]
  </code></pre>