else Last updated: 31. May 2023

Keyword

For use in if statements, runs code statement or block if criteria evaluates to "false".

Parameters

This function takes no parameters

Returns

nothing

Example

Data

{
"value1" : "testing"
}

Code example (#JS)

#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.
#if (value1 == "abcd") {#
    value1 is abcd
#} else {#
    value1 is NOT abcd
#}#

Output

The #JS code above produces the output shown below:
    value1 is NOT abcd

Code example (JS)

JS is normal JavaScript either running in the browser or on the Docly™ server.
var value1 = "testing";

if (value1 == "abcd") /* this criteria will evaluate to false */
    write("value1 is abcd"); /* therefore this will not run */
else
    write("value1 is NOT abcd"); /* instead this will run */

Output

The JS code above produces the output shown below:
value1 is NOT abcd