title: Compare and Delete the items in jquery array objects
body: <p>I am collecting a list of users for each request and pushing the list of users into arrays  like below:</p>
  
  <pre><code>$.each(data, function (i, item) {
      jQuery.each(array, function (index, data) {
          if (data.UserId == user.Id) {
              //do nothing
          }
      });
  
      else{
          array.push(UserId:user.Id);
      }
  
  });
  </code></pre>
  
  <p>Then, I am sending these data to the server:</p>
  
  <pre><code>jQuery.ajax({
      cache: false,
      type: "GET",
      url: "Handler.ashx",
      contentType: "application/json; charset=utf-8",
      data: { UsersData: JSON.stringify(array) },
      dataType: "json"
  });
  </code></pre>
  
  <p>Now at next time, I have to find the object as previous and to delete the users who are not presented in users list and I have to send into request. Please can any one tell me how to add the list of users into array and to delete the users from array who are not in list of users.</p>