title: How to insert objects through javascript?
body: <p>I have stored group of objects into one array called 'resData' and i'm having one more array of data called 'approvedIds', there have included all approved id's. Here i want to match these two arrays and add one new key into 'resData' array like 'approveStatus:"approve"'. How to do this one in javascript?</p>
  
  <p>All data's,</p>
  
  <pre><code>var resData = [
      {
          firstName:"Jhon",
          lastName:"adam",
          emailId:"jhn12@gmail.com",
          id:"01"
      },
      {
          firstName:"Kyle",
          lastName:"Miller",
          emailId:"kl12@gmail.com",
          id:"02"
      },
      {
          firstName:"Jhonathan",
          lastName:"adam",
          emailId:"jadm12@gmail.com",
          id:"03"
      },
      {
          firstName:"Lewis",
          lastName:"harber",
          emailId:"lewh12@gmail.com",
          id:"04"
      }
  ];
  </code></pre>
  
  <p>Approved id's array, </p>
  
  <pre><code>var approvedIds = ['01', '03'];
  </code></pre>
  
  <p>My output will be like this,</p>
  
  <pre><code>var resData = [
          {
              firstName:"Jhon",
              lastName:"adam",
              emailId:"jhn12@gmail.com",
              id:"01",
              approveStatus:'approved'
          },
          {
              firstName:"Kyle",
              lastName:"Miller",
              emailId:"kl12@gmail.com",
              id:"02"
          },
          {
              firstName:"Jhonathan",
              lastName:"adam",
              emailId:"jadm12@gmail.com",
              id:"03",
              approveStatus:'approved'
          },
          {
              firstName:"Lewis",
              lastName:"harber",
              emailId:"lewh12@gmail.com",
              id:"04"
          }
      ];
  </code></pre>