title: Undefined error getting in javascript (React Native)
body: <p>I am storing particular key value in Database. But, While fetching the key value, getting <strong>undefined</strong> error.</p>
  
  <pre><code>await DbHandler.fetch(codeStatus)
    .then((result) =&gt; {
      const codeEnabledObj = result[0];
      console.log('codeEnabledObj', codeEnabledObj);
      let codeEnabled = false;
      if (codeEnabledObj &amp;&amp; codeEnabledObj.length &gt; 0) { // this code not executing at all.
        codeEnabled = codeEnabledObj[0].isEnabled;
      }
      console.log('codeEnabled', codeEnabled); // getting false always
      console.log('codeEnabledObj.length[0]', codeEnabledObj.length); // undefined
  
    })
    .catch((error) =&gt; {
  
    });
  </code></pre>
  
  <p>The issue is, It's not going inside if condition and throwing error like undefined.</p>
  
  <p>But, If we print the response from db fetch</p>
  
  <pre><code>'codeEnabledObj', { type: 'codeStatus', isEnabled: true } // This is my response
  </code></pre>
  
  <p>Any suggestions?</p>