Usage: {{#unless featured}}{{/unless}}
{{#unless}}
block helper comes built in with Handlebars.
{{#unless}}
is essentially the opposite of {{#if}}
. If you want to test a negative conditional only, i.e. if you only need the {{else}}
part of an {{#if}}
statement, then {{#unless}}
is what you need.
It works exactly the same as {{#if}}
and supports both {{else}}
and ^
negation if you want to get really confusing!
Unless also uses the exact same conditional evaluation rules as {{#if}}
.
featured
evaluates to false.
{{#if}}
is more readable: