title: Remove items from array using id with Javascript
body: <p>I have a function like this: <code>pickListSelect array</code> is has all id (numbers) to delete objects in <code>source array</code>, and <code>target array</code> it is to push elements deleted from <code>source array</code>.    </p>
  
  <pre><code>    function copy(pickListSelect, source, target) {
  
           var i, id;
  
           for (i = 0; i &lt; pickListSelect.length; i++) {
                id = pickListSelect[i];              
                source.splice(id,1);
           }
           pickListSelect = [];
     }
  </code></pre>
  
  <p>So what I need is delete specific object from <code>source arra</code>y. I tried with that code but for example if I need to delete object with id=5, it only deleted item 5 from the list.</p>
  
  <p>The structure of source array is this:</p>
  
  <pre><code>    [Object, Object, Object, Object, Object, Object, Object, Object, Object]
      0:Object
      plantId:1
      plantName:"Plant 1"
  
  ...the rest of others are similar object
  </code></pre>