title: Error: JSON.parse: unexpected character at line 2 column 1 of the JSON data
body: <p>I have function which return json data </p>
  
  <pre><code>transformResponse : function(data) {
     return JSON.parse(data).results;
   }
  </code></pre>
  
  <p>When function call it getting error</p>
  
  <blockquote>
    <p>Error: JSON.parse: unexpected character at line 2 column 1 of the
    JSON data</p>
  </blockquote>
  
  <p>If their is no data then JSON.parse(data).results [ ] empty. 
  I think the error is due to this [ ] object </p>
  
  <p>So how to check is return empty is json or not??</p>