title: es6 deconstructing an object using a constant
body: <p>I was playing with es6 deconstruct feature and I did the following</p>
  
  <pre><code>const state = { a: 1 };
  const ID = 'b';
  const newState = { ...state, [ID]: 2 }
  </code></pre>
  
  <p>As you can see I use the value of the constant as the identifier, generating this new object.</p>
  
  <pre><code>//newStateValue ==&gt; { a:1, b:2 }
  </code></pre>
  
  <p>I was wondering how the [ID] works?</p>
  
  <p>Thanks</p>