title: JQUERY If Var is empty
body: <p>I have a form field that can be empty or not.</p>
  
  <p>I'm using the following code to pass the value of the field to <strong>foo</strong>. (note the +)</p>
  
  <pre><code>foo = +$('[name=test]').val();
  </code></pre>
  
  <p>I show what is in <strong>foo</strong> on the console</p>
  
  <pre><code>console.log(foo);
  </code></pre>
  
  <p>If nothing has been entered in the field, the console shows <strong>0</strong></p>
  
  <p>If enter a value 123 into the field, then the console shows that value.</p>
  
  <p>With this code if I enter 0 in the form field this still works !</p>
  
  <pre><code>    if (foo &gt;= 1) 
      {
     alert (BLAHH);
      }
  </code></pre>
  
  <p>If I enter nothing in the form field then no alert is shown, if I enter 123 the alert is show..  </p>
  
  <p>If I enter 0 the alert is show !  Why ?</p>
  
  <p>I've also tried <code>(if foo != 0)</code> and  <code>(if foo !== 0)</code> and various other combinations. But I get the same result..</p>
  
  <p>Any ideas ?
  Thanks</p>