title: How to compare two arrays and returns the list of deleted/updated/inserted elements in JavaScript?
body: <p>I have two set of object arrays . As below , I want to compare these two arrays and get the deleted/updated/inserted list of elements as a new array.
  How to achieve this properly in JavaScript. Is there any API available by default?</p>
  
  <pre><code>[
      {
          user_id: 1,
          user_name: "XXXX",
          location:"India"
  
      },
      {
          user_id: 2,
          user_name: "YYYY",
          location:"India"
  
      },
      {
          user_id: 3,
          user_name: "ZZZZ",
          location:"India"
  
      }
  
  ]
  
  [
      {
          user_id: 1,
          user_name: "XXXX",
          location:"United States"
  
      },
      {
          user_id: 3,
          user_name: "ZZZZ",
          location:"India"
  
      },
      {
          user_id: 4,
          user_name: "AAAA",
          location:"Germany"
  
      },
      {
          user_id: 5,
          user_name: "BBBB",
          location:"England"
  
      }
  
  ]
  </code></pre>