{% if list && list.length>0 %} and {{ someVal || "test"}}
https://github.com/mozilla/nunjucks/issues/344#issuecomment-70645452
We do aim to have as close API/syntax to jinja as much as possible, so adding && || !, although familiar to javascript, would potentially polute and confuse, having multiple ways of doing the same thing.
Agreed, we don't need redundant syntax for things that already exist.
The documentation for if (https://mozilla.github.io/nunjucks/templating.html#if) says "It behaves exactly as javascript's if behaves".
// And Snippet
{% if (VARIABLE > 10) and (VARIABLE < 20) %}
//
{% endif %}
// Or Snippet
{% if (VARIABLE == 10) or (VARIABLE == 20) %}
//
{% endif %}
The documentation for if (https://mozilla.github.io/nunjucks/templating.html#if) says "It behaves exactly as javascript's if behaves".
I was mislead by the document as well.
Most helpful comment
The documentation for if (https://mozilla.github.io/nunjucks/templating.html#if) says "It behaves exactly as javascript's if behaves".