title: How to handle true/false values in JSON object
body: <p>I have problem where my JSON object has True instead of true and False instead of false. That is causing issues when I parse it to JSON. How do I resolve this issue?
  In below script obj2 is not working as I have boolean True but not string.</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  
  &lt;h2&gt;Creating an Object from a JSON String&lt;/h2&gt;
  
      &lt;p id=&quot;demo1&quot;&gt;&lt;/p&gt;
      &lt;p id=&quot;demo2&quot;&gt;&lt;/p&gt;
      
      &lt;script&gt;
      const txt1 =  '{&quot;device_state&quot;: {&quot;device_name&quot;: &quot;iPhone&quot;, &quot;is_phone&quot;: true, &quot;is_VOX&quot;: false}}'
      const obj1 = JSON.parse(txt1);
      document.getElementById(&quot;demo1&quot;).innerHTML = obj1.device_state.device_name
      const txt2 =  '{&quot;device_state&quot;: {&quot;device_name&quot;: &quot;iPhone&quot;, &quot;is_phone&quot;: True, &quot;is_VOX&quot;: false}}'
      const obj2 = JSON.parse(txt2);
      document.getElementById(&quot;demo2&quot;).innerHTML = obj2.device_state.device_name
      &lt;/script&gt;
      
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>