areEqual(value1, value2) Last updated: 16. May 2026

API only function

Checks if value1 and value2 are equal. Typically used to validate that two fields match (e.g. password confirmation).

See also: areNotEqual isNull assert

Parameters

Name Type Description
value1 object Value to compare with value2.
value2 object Value to compare with value1.

Returns

True if value1 and value2 are equal, otherwise false.

Example

Data

{
"password" : "secret",
"confirm" : "secret"
}

Code example (#JS)

#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.
#docly.areEqual(password, confirm) ? "Match" : "No match"#

Output

The #JS code above produces the output shown below:
Match

Code example (JS)

JS is normal JavaScript either running in the browser or on the Docly™ server.
write(docly.areEqual("abc", "abc"));
write("\n");
write(docly.areEqual(1, 2));
/* Expected output:
true
false
*/