title: Immutability removing key from object by destructuring
body: <p>I have an object with a simplified structure like so:</p>
  
  <pre><code>state = {
    todo: {
      1: {text: 'Buy apples'},
      2: {text: 'Buy milk'}
    }
  }
  </code></pre>
  
  <p>If I wanted to remove a todo item immutability, according to other answers on Stack Overflow I could destructure the todo's list:</p>
  
  <pre><code>const idToDelete = 2
  
  let {
    [idToDelete]: deleted,
    ...newTodo
  } = state.todo
  </code></pre>
  
  <p>If I do <code>console.log(newTodo)</code>, then it has the same value of <code>state.todo</code>, meaning that it hasn't removed to todo item with id of 2. If I  <code>console.log(deleted)</code> then it returns the contents of the todo I want to delete: <code>{text: 'Buy milk'}</code>.</p>
  
  <p>I'm aware that it would be somewhat easier to manage this using a library  such as Immutable.js, however I would like to know why destructuring the object does not remove the todo item. Thanks.</p>