Docly Developers
Function Updated 17 Oct 2026

if(criteria)

Evaluates a condition and runs code if it is true. The condition uses standard JavaScript truthiness: false, 0, NaN, "" (empty text), null and undefined are false; everything else — including "0", "false", [] and — is true.

Parameters

criteriaboolrequired

Bool statement or value to evaluate.

Returns

Nothing

Example

Mixed HTML (or any text file) with inline JavaScript between hash signs.
#if(value1) {#
<b>If condition content</b>
#} else {#
<i>Else content</i>
#}#