title: Why is JSON.parse changing the values in nested arrays?
body: <p>To learn Angular 2, I made a <a href="https://cmermingas.github.io/connect-four-web-worker/" rel="nofollow">Connect Four game</a> with Angular CLI when it used SystemJS.</p>
  
  <p>I am replicating the effort from scratch with the new Webpack-based CLI and I am having a strange problem...</p>
  
  <p>The following method receives a string with JSON-encoded data and initializes a new game instance with it. I added a few <code>console.log</code> to show the problem:</p>
  
  <pre><code>export class ConnectFourGameModel {
    static fromJSON(jsonString: any): ConnectFourGameModel {
      let jsonData = JSON.parse(jsonString);
  
      console.log('*** from JSON (compare the "columns" array between jsonString and jsonData below) ***');
      console.log('jsonString: ', jsonString);
      console.log('jsonData: ', jsonData);
  
      ...
      return result;
  }
  </code></pre>
  
  <p>When this runs, the first <code>console.log</code> shows the JSON string correctly:</p>
  
  <pre><code>jsonString:
  {... Several fields here ...
   "columns":[[0,0,0,0,0,1],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0]]
  }
  </code></pre>
  
  <p>But the second <code>console.log</code>, which is just the result of calling <code>JSON.parse</code> on this string, seemingly randomly changes the values:</p>
  
  <pre><code>jsonData:
  &gt; Object {... Several fields here ...
    &gt; columns: Array[15]
      V 0: Array[6]
          0: 2     &lt;-- Should be 0
          1: 2     &lt;-- Should be 0
          2: -1    &lt;-- Should be 0
          etc...
  </code></pre>
  
  <p><strong>Why is this happening?</strong></p>
  
  <p>You can probably see it better if you <a href="https://cmermingas.github.io/connect-four-webpack/" rel="nofollow">load the app on Github Pages</a>, open the JavaScript console on the browser, and click on any column to make a move.</p>
  
  <p>The repository is on Github: <a href="https://github.com/cmermingas/connect-four-webpack" rel="nofollow">https://github.com/cmermingas/connect-four-webpack</a></p>
  
  <p>I looked for questions here regarding <em>parsing nested arrays with JSON.parse</em> but I couldn't relate this issue to the ones I found.</p>
  
  <p>Thanks a lot in advance!</p>