title: Javascript/Lodash - Removing an item from an array (has the same id)
body: <p>I am trying to remove an item from an array that has several objects, where in some cases it may has the same id. Here is the array :</p>
  
  <pre><code>var array = [{
  "outletId": "OjHJ104",
  "items": [{
          "objectId": "lQnt4dmiPs",
          "inCart": false,
      },
      {
          "objectId": "lQnt4dmiPs",
          "inCart": true,
      },
      {
          "objectId": "lQnt4dmiPs",
          "inCart": false,
      },
      {
          "objectId": "lC6C96Ekua",
          "inCart": true,
      },
      {
          "objectId": "lC6C96Ekua",
          "inCart": false,
      },
      {
          "objectId": "lC6C96Ekua",
          "inCart": true,
      }
    ]
   }];
  </code></pre>
  
  <p>Let's say I want to remove the item with the objectId : <strong>lQnt4dmiPs</strong></p>
  
  <p>Using the below :</p>
  
  <pre><code>_.remove(array, { objectId: 'lQnt4dmiPs' });
  </code></pre>
  
  <p>It's true that it removes the item; however it removes all the objects that has the objectId : <strong>lQnt4dmiPs</strong> which is not the wanted behavior. I want to remove it only once (as the remove function triggers onclick..).</p>
  
  <p>I believe that I am missing something here or rather I should use another lodash function.</p>