In Handlebars, is there a ternary operator? I don\'t mean if else; I mean like a == true ? \"a\" : \"b\".
This below code can be used for ternary or any kind of expression eval.
Warning: please use this code in scenario where eval can be used safely.
{{#if (myfunc "(a[0] + 1) % 2 === 0" arg1)}}
{{/if}}
{{#if (myfunc "(a[0] + a[1]) % 2 === 0" arg1 arg2)}}
{{/if}}
handlebar helper function
myfunc: (exp, ...a) => {
return eval(exp);
}