title: REACT Delete Element in array of objects
body: <p>I am having trouble deleting an element inside an array of objects. I want to simply delete an object inside the array. When I try to use .IndexOf(). It gives me back -1. is there a way to do this without creating a reference to each object.</p>
  
  <p>This is my Array of objects.</p>
  
  <pre><code>   let todos = [{
        id: 1,
        task: 'Finish This React App'
      },{
        id: 2,
        task: 'Do Another App'
      },{
        id: 3,
        task: 'Pass data from the parent to the child and reverse'
      }]
  
  let task = {id:2,task:'Do Another App'}
  
  let todosArray = this.props.todos
  
  todosArray.indexOf(task,0) //= -1
  </code></pre>
  
  <p>Overall I want to only have objects 1 and 3 inside the todos array.</p>