title: How to delete an item from state array?
body: <p>The story is, I should be able to put Bob, Sally and Jack into a box. I can also remove either from the box. When removed, no slot is left.</p>
  
  <pre><code>people = ["Bob", "Sally", "Jack"]
  </code></pre>
  
  <p>I now need to remove, say, "Bob". The new array would be:</p>
  
  <pre><code>["Sally", "Jack"]
  </code></pre>
  
  <p>Here is my react component:</p>
  
  <pre><code>...
  
  getInitialState: function() {
    return{
      people: [],
    }
  },
  
  selectPeople(e){
    this.setState({people: this.state.people.concat([e.target.value])})
  },
  
  removePeople(e){
    var array = this.state.people;
    var index = array.indexOf(e.target.value); // Let's say it's Bob.
    delete array[index];
  },
  
  ...
  </code></pre>
  
  <p>Here I show you a minimal code as there is more to it (onClick etc). The key part is to delete, remove, destroy "Bob" from the array but <code>removePeople()</code> is not working when called. Any ideas? I was <a href="https://stackoverflow.com/questions/5767325/remove-a-particular-element-from-an-array-in-javascript">looking at this</a> but I might be doing something wrong since I'm using React.</p>