title: Removing value from object in Angular 6
body: <p>I have some object in Angular like this</p>
  
  <pre><code>documents = [
  {name: "sto.jpg", selected: false}
  {name: "stosecen.jpg", selected: false}
  {name: "red.png", selected: false}
  {name: "maxresdefault.jpg", selected: false}
  ];
  </code></pre>
  
  <p>And some array like this</p>
  
  <pre><code>documentsForDelete = ["sto.jpg", "stosecen.jpg"];
  </code></pre>
  
  <p>I need to remove values from documents from documentsForDelete</p>
  
  <p>This is what i have tried and no luck</p>
  
  <pre><code>  remove(array, element) {
      const index = array.indexOf(element);
      array.splice(index, 1);
    }
  
  remove(documents.name, documentsForDelete);
  </code></pre>