Strict Equality (===) Comparison Operator Summary Compares two expressions for value and type equality. Syntax expression1 === expression2 Parameters expression1 Any legal expression. expression2 Any legal expression. Description The strict equality operator compares the values and types of two expressions. The strict equality operator returns true if the resulting values and types of the expressions are equal and false otherwise. This operator is inherited from JavaScript. If your code uses JS++ types only (such as the int type), strict equality may be redundant. This is because the types are already checked by the JS++ type checker at compile time: 123456import System; int x = 1, y = 1; Console.log(x === y); // Redundant, type is already checked at compile timeConsole.log(x == y); // Has the same meaning for non-external (JS++) types However, if at least one side of the comparison expression uses JavaScript types (declared with var, function, or external), it is recommended to use the strict equality operator: 123456import System; int x = 1;var y = "1"; Console.log(x === y); // 'y' has external (JavaScript) type. Use strict equality (===) over regular equality (==). Examples Comparing JavaScript Types and Values 12345import System; var x = 1, y = 1, z = "1";Console.log(x === y); // trueConsole.log(y === z); // false See Also true false Equality Comparison Operator Inequality Comparison Operator Strict Inequality Comparison Operator Share HTML | BBCode | Direct Link