title: wierd oddity between JsonConvert.SerializeObject and json.stringify
body: <p>I'm working with a JavaScript client and a c# socket server sending messages back and forth in JSON.</p>
  
  <p>on the server I have a multi-dimensional array like so:</p>
  
  <pre><code>MapData[0,0,0] = 1;
  MapData[0,0,1] = 2;
  </code></pre>
  
  <p>its dimensions are 900x900x2</p>
  
  <p>in JavaScript if I do <code>json.stringify(MapData)</code> I get like this</p>
  
  <p><code>[[[1,2],[3,4]]]</code> etc</p>
  
  <p>but c# <code>jsonconvert.serializeobject(MapData)</code> gives me like this:
  [1,2,3,4]</p>
  
  <p>can someone explain why the c# serialize and JavaScript stringify are giving different values ?</p>
  
  <p>I tried</p>
  
  <pre><code>int[][][] MapData = new int[900][][];
  // Zero out the map
  for (int variable1 = 0; variable1 &lt;= 899; variable1++) {
      for (int variable2 = 0; variable2 &lt;= 899; variable2++) {
          MapData[variable1][variable2][0] = 0;
      }
  }
  </code></pre>
  
  <p>but it throws an unhandled null exception at MapData[variable1][variable2][0] = 0;</p>
  
  <p>Finally figured it out with Jeff's help</p>
  
  <pre><code>int[][][] MapData = new int[900][][];
  // Zero out the map
  for (int a = 0; a &lt; MapData.Length; a++)
  {
      MapData[a] = new int[900][];
      for (int b = 0; b &lt; MapData[a].Length; b++)
      {
          MapData[a][b] = new int[2];
          for (int c = 0; c &lt; MapData[a][b].Length; c++)
                  MapData[a][b][c] = 0;
      }
  }
  </code></pre>
  
  <p>then the JsonConvert.SerializeObject(MapData) works like I want</p>
  
  <p>Thankyou for pointing me in the right direction Jeff</p>