title: Unexpected token u in JSON at position 0 when trying to access a field of JSON
body: <p>The following is the json that I am receiving:</p>
  
  <pre><code>{
  "total": 5,
  "responses": [{
      "gender": "Female",
      "age": 66
  }, {
      "gender": "Male",
      "age": 52
  }]
  }
  </code></pre>
  
  <p>The following is the code I am using to receive and parse the json</p>
  
  <pre><code>// Declare a proxy to reference the hub.
  $.connection.hub.url = 'https://www.url...';
  var res = $.connection.resHub;
  // Create a function that the hub can call to broadcast messages.
  res.client.broadcastRes = function (resp) {
   var now = new Date();
   console.log(now.toLocaleTimeString(), 'signalR survey data received', JSON.parse(resp));
   createChart(JSON.parse(resp.responses));
  };
  $.connection.hub.start();
  </code></pre>
  
  <p>In the console I am being able to see the entire JSON response like I showed above by doing <code>console.log(JSON.parse(resp));</code></p>
  
  <p>But I am getting the error </p>
  
  <blockquote>
    <p>Unexpected token u in JSON at position 0
        at JSON.parse ()</p>
  </blockquote>
  
  <p>When I am using <code>resp.responses</code></p>
  
  <p>Where am I going wrong?</p>
  
  <p>Any kind of help would be greatly appreciated. Thanks.</p>