title: Why do all numbers except 0 pass an if statement in JavaScript?
body: <p>This is something that I've always wondered. According to MDN, in JavaScript "The if statement executes a statement if a specified condition is true". So then why does this pass the statement?</p>
  
  <pre><code>var a = 7;
  if( a ) {
      alert('true');
  } else {
      alert('false');
  }
  </code></pre>
  
  <p>The variable is neither true nor false, so why does it alert "true" instead of just skipping the entire if statement?</p>