title: Error in parsing json array accepting multiple values
body: <p>Whenever i am giving a single data element in my json file my code works fine,but as soon as i give an array of elements it <strong>starts showing undefined on the client side</strong>.
  This is my server side code.</p>
  
  <pre><code>var app = require('express')()
    , server = require('http').createServer(app)
    , io = require('socket.io').listen(server);
  var fs= require('fs');
  server.listen(3000);
  
  app.get('/', function (req, res) {
    res.sendfile(__dirname + '/cli_index.html');
  });
  
  io.sockets.on('connection', function (socket) {
  var file = __dirname + '/data.json';
    fs.readFile(file, 'utf8', function (err, data) {
      if (err) {
        console.log('Error: ' + err);
        return;
      }
      data = JSON.parse(data);
    // You can save those values somewhere or just log them to the console
      console.log(data);
      socket.emit('news', { hello: data});
   });
  
    });
  </code></pre>
  
  <p>This is my client side code.</p>
  
  <pre><code>&lt;script src="/socket.io/socket.io.js"&gt;&lt;/script&gt;
  &lt;script&gt;
    var socket = io.connect('http://localhost');
    socket.on('news', function (data) {
  
   JSON.stringify(data);
    for(var i=0;i&lt;2;i++){
     document.write(data[i].hello.name);
  }
    });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>This is my external json file.</p>
  
  <p><code>[{"name":"hey"},{"name":"Gouraw"}]</code></p>