title: How to check a variable contains JSON object or string?
body: <p>Is it possible to check data in a variable is string or JSON object?</p>
  
  <pre><code>var json_string = '{ "key": 1, "key2": "2" }';
  
  var json_string = { "key": 1, "key2": "2" };
  
  var json_string = "{ 'key': 1, 'key2', 2 }";
  </code></pre>
  
  <p>When json_string.key2 return 2 or when undefined.</p>
  
  <p>When we need to Use JSON.parse ?</p>
  
  <p>How I check which one is string or JSON object.</p>