title: Why can I change a constant object in javascript
body: <p>I know that ES6 is not standardized yet, but a <a href="http://kangax.github.io/es5-compat-table/es6/" rel="nofollow noreferrer">lot of browsers currently support</a> <code>const</code> keyword in JS.</p>
  <p>In spec, it is written that:</p>
  <blockquote>
  <p>The value of a constant cannot change through re-assignment, and a
  constant cannot be re-declared. Because of this, although it is
  possible to declare a constant without initializing it, it would be
  useless to do so.</p>
  </blockquote>
  <p>and when I do something like this:</p>
  <pre><code>const xxx = 6;
  xxx = 999;
  xxx++;
  const yyy = [];
  yyy = 'string';
  yyy = [15, 'a'];
  </code></pre>
  <p>I see that everything is ok: <code>xxx</code> is still <code>6</code> and <code>yyy</code> is <code>[]</code>.</p>
  <p>But if I do <code>yyy.push(6); yyy.push(1); </code>, my constant array has been changed. Right now it is <code>[6, 1]</code> and by the way I still can not change it with <code>yyy = 1;</code>.</p>
  <p>Is this a bug, or am I missing something? I tried it in the latest chrome and FF29</p>