title: Bug when sending array in node.js and socket.io
body: <p>I use socket.io version 0.8.4</p>
  
  <p>I have boiled down my problem to the following. I have data looking like this:</p>
  
  <pre><code>data.prop1 = [];
  data.prop1.push("man");
  data.prop2 = [];
  data.prop2["hey"] = "man";
  </code></pre>
  
  <p>I send the data from the server to the client this way:</p>
  
  <pre><code>socket.emit("data", data);
  </code></pre>
  
  <p>On the client side I receive the data this way:</p>
  
  <pre><code>socket.on("data", function(data){ console.log(data); });
  </code></pre>
  
  <p>The weird thing is:</p>
  
  <pre><code>data.prop1 = [];
  data.prop1.push("man"); // This data exists in the client side data object
  data.prop2 = [];
  data.prop2["hey"] = "man"; // This data does not exist.
  </code></pre>
  
  <p>data.prop2 is just an empty array on the client side.</p>
  
  <p>Is there a known bug in json serializing arrays on the form in prop2?</p>
  
  <p>Thankyou in advance</p>
  
  <p>EDIT:</p>
  
  <p>Problem solved using this workaround:</p>
  
  <pre><code>data.prop1 = [];
  data.prop1.push("man");
  data.prop2 = {}; // &lt;= Object instead of array
  data.prop2["hey"] = "man";
  </code></pre>