title: How to check if a value is not null and not empty string in JS
body: <p>Is there any check if a value is not null and not empty string in Javascript? I'm using the following one:</p>
  
  <pre><code>var data; //get its value from db 
  if(data != null &amp;&amp; data != '') {
     // do something
  }
  </code></pre>
  
  <p>But I'm wondering if there is another better solution. Thanks.</p>