Conditionals and Loops in Templates with Handlebars JS
Handlebars has support for basic logic built in. In this case a helper function is registered which uses an if/else statement to deliver different text to the template depending on the value of a variable (in this case a stock quantity value.)