Function Updated 17 Oct 2026
isNull(value)
Checks if specified value is null. Useful for null-checks in form validation or before-write checks.
Parameters
valueanyrequiredThe value to check.
Returns
true if the value is null or undefined, otherwise false. An empty string and 0 give false.
Example
Mixed HTML (or any text file) with inline JavaScript between hash signs.
<p>
Is value1 null?
#docly.isNull(value1) ? "Yes" : "No"#
</p>
<p>
Is value2 null?
#docly.isNull(value2) ? "Yes" : "No"#
</p>The template above produces this output:
<p>
Is value1 null?
No
</p>
<p>
Is value2 null?
Yes
</p>Normal JavaScript, running in the browser or on the Docly™ server.
write(docly.isNull(null));
write("\n");
write(docly.isNull("hello"));
/* Expected output:
true
false
*/The JavaScript above produces this output:
true
falseThe data the example runs with:
{
"value1" : "asdf",
"value2" : null
}