strictEqual Function

Applies to TestComplete 15.64, last modified on June 12, 2024

Performs strict equality comparison (===). Strict comparison is only true if the compared expressions are of the same type and the contents match.


strictEqual(ab) Parameters
a [in] Required Variant
b [in] Required Variant
Result     Boolean  


Due to JavaScript specifics, strict equality comparison a===b may return a wrong result if at least one of the compared values has been obtained from a TestComplete object or a COM object. For example, when you compare properties of objects in your tested application. To avoid comparison errors, use strictEqual(a, b) instead of a===b, and !strictEqual(a, b) instead of a!==b.


a, b

The expressions to compare.


true if the values are strictly equal, that is, have the same type and value. Otherwise, false.



strictEqual(2, 2)    // true
strictEqual(2, 2.0)  // true
strictEqual(2, "2")  // false
strictEqual(0, false) // false

See Also

equal Function
JavaScript - Specifics of Usage

Highlight search results