title: Id of object mus be removed based on matching req.params.id
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>router.delete('/shopping-cart/:id', (req, res) =&gt; {
      let cart = new Cart(req.session.cart);
      console.log(req.params.id);
      console.log(cart.generateArray());
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>console.log will output the following result (req.params.id): </p>
  
  <p>5c863cc8ee0819f989acf9c3</p>
  
  <p>console.log will output the following result (cart.generateArray()): </p>
  
  <pre><code>[ { item: 
   { _id: '5c863cc8ee0819f989acf9c3',
     imagePath: 'https://upload.wikimedia.org/wikipedia/en/5/5e/Gothiccover.png',
     title: 'Gothic Video',
     description: 'Absolutely stunning',
     price: 10,
     __v: 0 },
  image: 'https://upload.wikimedia.org/wikipedia/en/5/5e/Gothiccover.png',
  qty: 1,
  price: 10,
  id: '5c863cc8ee0819f989acf9c3' } ]
  </code></pre>
  
  <p>So how do I loop through all the items and check if id matches the req.params.id. If that is the case, it should remove that object and then return an updated array on the client side. </p>