title: How to remove item from array object in jquery
body: <p>How to remove item from jquery array object. </p>
  
  <p>I used splice method as follows. But it slice next item of array[i].</p>
  
  <pre><code>    $.each(array, function (i, item) {
      var user = array[i];
      jQuery.each(array2, function (index, idata) {
          debugger
          if (idata.Id == user.UserId) {
              tempFlag = 1;
              return false; // this stops the each
          }
          else {
              tempFlag = 0;
          }
      });
  
      if (tempFlag != 1) {
       //removes an item here
  
          array.splice(user, 1);
      }
  })
  </code></pre>
  
  <p>Can anyone tell me where i am wrong here?</p>