title: How to check if a variable is not null?
body: <p>I know that below are the two ways in JavaScript to check whether a variable is not <code>null</code>, but I’m confused which is the best practice to use.</p>
  
  <p>Should I do:</p>
  
  <pre><code>if (myVar) {...}
  </code></pre>
  
  <p>or</p>
  
  <pre><code>if (myVar !== null) {...}
  </code></pre>