In my Handlebars template I check for the existence of a variable, and render some text if it's there:
{{#if foo}}
some text
{{/if}}
This works fine if foo is text or if foo is numeric but not zero. But if
var foo = 0;
then {{#if foo}}
returns false.
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'.
How can I do the same thing in Handlebars?
I could write an {{#exists}}
helper, but I was hoping there was something built in.