title: Node.js - JSON error Unexpected Token
body: <p>I'm trying to send some data into a Node server from AS3 through JSON. I have written this JSON for test purposes and sent this data to node (<strong>AS3</strong>):</p>
  
  <pre><code>var usrJson = [{"id": "21", "name": "testName"}];
  usrJson = JSON.stringify(usrJson);
  socket.send(usrJson);
  </code></pre>
  
  <p>The object reaches the node server, because when I console.log it, it is ok, but when i console.log a property of this object with this (<strong>JS</strong>):</p>
  
  <pre><code>function onData(d){
  
      strData = d.toString();
  
      console.log(strData);     // returns [{"id": "21", "name": "testName"}]
  
      json = JSON.parse(strData);
      console.log(json);           // Returns the error below
  
  }
  </code></pre>
  
  <p>The error shown:</p>
  
  <pre><code>[{"id": "21", "name": "testName"}]
                                    ^
  Syntax Error: Unexpected Token
  </code></pre>
  
  <p>I tried verifying my JSON with JsonLint and it was ok. Maybe I'm missing something in the js file.</p>
  
  <p>Thanks in advance.</p>