title: Handlebars #if and numeric zeroes
body: <p>In my Handlebars template I check for the existence of a variable, and render some text if it's there:</p>
  
  <pre><code>{{#if foo}}
    some text
  {{/if}}
  </code></pre>
  
  <p>This works fine if foo is text or if foo is numeric but not zero. But if</p>
  
  <pre><code>var foo = 0;
  </code></pre>
  
  <p>then <code>{{#if foo}}</code> returns false.</p>
  
  <p>This appears to be yet another Javascript oddity, because Javascript itself behaves the same way. In Javascript code, though, you could get around this by checking if the variable is 'undefined'. </p>
  
  <p>How can I do the same thing in Handlebars? </p>
  
  <p>I could write an <code>{{#exists}}</code> helper, but I was hoping there was something built in.</p>