title: TypeError: invalid 'in' operand obj
body: <pre><code>       json= new Gson().toJson(name);
  </code></pre>
  
  <p>where name is of type string.</p>
  
  <p>I am getting error saying  "TypeError: invalid 'in' operand obj "</p>
  
  <p>error is in  the given part of java script</p>
  
  <pre><code> return type === "array" || type !== "function" &amp;&amp;
       ( length === 0 ||
       typeof length === "number" &amp;&amp; length &gt; 0 &amp;&amp; ( length - 1 ) in obj );
  </code></pre>
  
  <p>I have also tried </p>
  
  <pre><code>   response=JSON.parse(response); 
  </code></pre>
  
  <p>which is not working.</p>