Function Updated 17 Oct 2026
areEqual(value1, value2)
Checks if value1 and value2 are equal. Typically used to validate that two fields match (e.g. password confirmation).
Values are compared with .NET equality, not with JavaScript ==: there is no type conversion, so "1" and 1 are not equal, and two objects or arrays are equal only if they are the same instance. Two null values are equal.
Parameters
value1objectrequiredValue to compare with value2.
value2objectrequiredValue to compare with value1.
Returns
true if value1 and value2 are equal, otherwise false. Also false if not called with exactly two arguments.
Example
Mixed HTML (or any text file) with inline JavaScript between hash signs.
#docly.areEqual(password, confirm) ? "Match" : "No match"#The template above produces this output:
MatchNormal JavaScript, 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
*/The JavaScript above produces this output:
true
falseThe data the example runs with:
{
"password" : "secret",
"confirm" : "secret"
}