title: Delete element in an array of object
body: <p>I need to delete element in an array of Object, look at my array:</p>
  
  <p>I want delete the elements which have <code>done == true</code>, look at my script:</p>
  
  <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>var items = [{text: "a", done: false}, {text: "b", done: false}, {text: "c", done: true}, {text: "d", done: true}, {text: "e", done: true}];
  
  
  items.forEach((elem, index) =&gt; {
    if(items[index].done) {
      items.splice(index, 1);
    }
  })
  
  console.log(items)</code></pre>
  </div>
  </div>
  </p>
  
  <p>But it's doesn't work.</p>