title: Can't access to a specfic field in JSON, saying undefined in javascript
body: <p>I have a project in Laravel + socket.io , I need to access a specific field in the json being broadcasted. Here is the code. </p>
  
  <p>socket.js</p>
  
  <pre><code>redis.on('message', function(channel, message) {
      message = JSON.parse(message);
      io.emit(channel + ':' + message.event,message.data); 
  });
  </code></pre>
  
  <p>In my client socket, I have this.</p>
  
  <pre><code>socket.on("comment-channel:App\\Events\\CommentEvent", function(message){
          alert(message.data);
   });
  </code></pre>
  
  <p>then this will successfully, alert this.</p>
  
  <pre><code>[{
      "id": 136,
      "content": "dffsadf",
      "user_id": "1",
      "task_id": "33",
      "created_at": "2016-03-29 10:47:19",
      "user": {
          "id": 1,
          "first_name": "Hulk",
          "last_name": "Hogan",
          "username": "",
          "email": " hulhogan@yahoo.com",
          "company_id": "1",
          "role_id": "0",
          "photo": "\/assets\/apps\/img\/photos\/lvrv5VOGRskwPHvFVakp.jpeg",
          "position": "asdfsadf",
          "phone": "+75843857834",
          "city": "",
          "country": "Singapore",
          "timezone": "",
          "created_at": "2016-03-10 04:16:24",
          "updated_at": "2016-03-10 07:54:12",
          "deleted_at": null
      }
  }]
  </code></pre>
  
  <p>Then when I try this</p>
  
  <pre><code>alert(message.data.task_id);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>alert(message.data['task_id']);
  </code></pre>
  
  <p>I get 'undefined'..</p>
  
  <p>How can I access, the task_id?Thank You!!!!</p>