title: Remove a random object from an array and return it
body: <p>I want to retrieve a random object from an array of objects, return that object, and also remove the object from the array. My code this fine, but I bet there's a far more neat manner to do it. Here's my version:</p>
  
  <pre><code>let deck = [{...}, {...}, {...}];
  function returnCard(deck) {
    let element = deck[Math.floor(Math.random() * deck.length)];
    removeCard(element);
    return element;
  }
  function removeCard(card) {
    deck = deck.filter(function(el) {
      return el.name !== card.name;
    });
  }
  </code></pre>
  
  <p>This looks verbose. I think part of what I'm struggling with is that I want to return, or reassign two things at once, the card and the deck. </p>