isNull(value) Last updated: 16. May 2026

Checks if specified value is null. Useful for null-checks in form validation or before-write checks.

See also: isNotNull assert areEqual

Parameters

Name Type Description
value any The value to check.

Returns

True if value is null, otherwise false.

Example

Data

{
"value1" : "asdf",
"value2" : null
}

Code example (#JS)

#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.
<p>
    Is value1 null?
    #docly.isNull(value1) ? "Yes" : "No"#
</p>
<p>
    Is value2 null?
    #docly.isNull(value2) ? "Yes" : "No"#
</p>

Output

The #JS code above produces the output shown below:
<p>
    Is value1 null?
    No
</p>
<p>
    Is value2 null?
    Yes
</p>

Code example (JS)

JS is normal JavaScript either running in the browser or on the Docly™ server.
write(docly.isNull(null));
write("\n");
write(docly.isNull("hello"));
/* Expected output:
true
false
*/

Output

The JS code above produces the output shown below:
true
false