title: Add additional object keys into array based on condition javascript
body: <p>My array:</p>
  
  <pre><code>[
    {
      name: 'test1',
      state: 'OK',
      status: true,
      pending: 33,
      approved: 0,
      active: 0,
      inactive: 33
    },
    {
      name: 'test3',
      state: 'OK',
      status: true,
      pending: 33,
      approved: 0,
      active: 0,
      inactive: 33
    },
    {
      name: 'test4',
      state: 'OK',
      status: true
    }
  ]
  </code></pre>
  
  <p>If the "pending", "approved", "active", "inactive" key not exists in object, i need output like this:</p>
  
  <p>Expected output:</p>
  
  <pre><code>[
    {
      name: 'test1',
      state: 'OK',
      status: true,
      pending: 33,
      approved: 0,
      active: 0,
      inactive: 33
    },
    {
      name: 'test3',
      state: 'OK',
      status: true,
      pending: 33,
      approved: 0,
      active: 0,
      inactive: 33
    },
    {
      name: 'test4',
      state: 'OK',
      status: true,
      pending: 0,
      approved: 0,
      active: 0,
      inactive: 0
    }
  ]
  </code></pre>
  
  <p>How to do this?</p>
  
  <p>I tried with map but i dont know how to set condition.</p>
  
  <p>I want to set the values into zero.</p>